Update launcher/ui/themes/CatPack.cpp

Co-authored-by: TheKodeToad <TheKodeToad@proton.me>
Signed-off-by: Alexandru Ionut Tripon <alexandru.tripon97@gmail.com>
This commit is contained in:
Alexandru Ionut Tripon 2023-06-23 14:25:21 +03:00 committed by GitHub
parent f8adb508ab
commit c5ea8367aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -78,7 +78,8 @@ JsonCatPack::JsonCatPack(QFileInfo& manifestInfo) : BasicCatPack(manifestInfo.di
const auto root = doc.object(); const auto root = doc.object();
m_name = Json::requireString(root, "name", "Catpack name"); m_name = Json::requireString(root, "name", "Catpack name");
auto id = Json::ensureString(root, "id", "", "Catpack ID"); auto id = Json::ensureString(root, "id", "", "Catpack ID");
m_id = id.isEmpty() ? m_id : id; if (!id.isEmpty())
m_id = id;
m_defaultPath = FS::PathCombine(path, Json::requireString(root, "default", "Deafult Cat")); m_defaultPath = FS::PathCombine(path, Json::requireString(root, "default", "Deafult Cat"));
auto variants = Json::ensureArray(root, "variants", QJsonArray(), "Catpack Variants"); auto variants = Json::ensureArray(root, "variants", QJsonArray(), "Catpack Variants");
for (auto v : variants) { for (auto v : variants) {