diff options
Diffstat (limited to 'primedev/mods')
-rw-r--r-- | primedev/mods/autodownload/moddownloader.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/primedev/mods/autodownload/moddownloader.cpp b/primedev/mods/autodownload/moddownloader.cpp index 165399e3..5d3e9254 100644 --- a/primedev/mods/autodownload/moddownloader.cpp +++ b/primedev/mods/autodownload/moddownloader.cpp @@ -88,7 +88,14 @@ void ModDownloader::FetchModsListFromAPI() // Load mods list into local state spdlog::info("Loading mods configuration..."); verifiedModsJson.Parse(readBuffer); - for (auto i = verifiedModsJson.MemberBegin(); i != verifiedModsJson.MemberEnd(); ++i) + assert(verifiedModsJson.HasMember("thunderstore")); + + // Check if the "thunderstore" key exists + auto verifiedModsJsonThunderstore = verifiedModsJson["thunderstore"]; + + assert(verifiedModsJsonThunderstore->value.IsObject()); + + for (auto i = verifiedModsJsonThunderstore.MemberBegin(); i != verifiedModsJsonThunderstore.MemberEnd(); ++i) { std::string name = i->name.GetString(); std::string dependency = i->value["DependencyPrefix"].GetString(); |