From 2660418d58efb33cd3a0ab8ed9d48c359c076905 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Sun, 19 Mar 2017 02:13:49 +0100 Subject: NOISSUE hack it together enough to get launching back Meta index will now always return valid objects. They just might never load if they don't exist on the server. --- api/logic/meta/Index.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'api/logic/meta/Index.cpp') diff --git a/api/logic/meta/Index.cpp b/api/logic/meta/Index.cpp index 35b9fb6f..0749651a 100644 --- a/api/logic/meta/Index.cpp +++ b/api/logic/meta/Index.cpp @@ -83,17 +83,19 @@ bool Index::hasUid(const QString &uid) const VersionListPtr Index::get(const QString &uid) { - return m_uids.value(uid, nullptr); + VersionListPtr out = m_uids.value(uid, nullptr); + if(!out) + { + out = std::make_shared(uid); + m_uids[uid] = out; + } + return out; } VersionPtr Index::get(const QString &uid, const QString &version) { auto list = get(uid); - if(list) - { - return list->getVersion(version); - } - return nullptr; + return list->getVersion(version); } void Index::parse(const QJsonObject& obj) -- cgit v1.2.3