Add more null protection for skin management

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97
2024-09-16 12:41:33 +03:00
parent bee59c904a
commit d38e7fa142
3 changed files with 18 additions and 6 deletions

View File

@ -336,7 +336,11 @@ void SkinList::save()
arr << s.toJSON();
}
doc["skins"] = arr;
Json::write(doc, m_dir.absoluteFilePath("index.json"));
try {
Json::write(doc, m_dir.absoluteFilePath("index.json"));
} catch (const FS::FileSystemException& e) {
qCritical() << "Failed to write skin index file :" << e.cause();
}
}
int SkinList::getSelectedAccountSkin()