From 54532ae1ba82c106c2c510a9cbde7b6f1c3b7c1d Mon Sep 17 00:00:00 2001 From: GeckoEidechse Date: Fri, 19 Jan 2024 23:42:35 +0100 Subject: temp: Commit working tree --- primedev/mods/autodownload/moddownloader.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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(); -- cgit v1.2.3