gamesdb: fix exception when boxart is missing

This commit is contained in:
Flyinghead 2022-06-26 21:55:00 +02:00
parent 7f28b767e4
commit 9a557978c4
1 changed files with 5 additions and 1 deletions

View File

@ -151,7 +151,11 @@ void TheGamesDb::parseBoxart(GameBoxart& item, const json& j, int gameId)
}
}
json dataArray = j.contains("data") ? j["data"][std::to_string(gameId)] : j["images"][std::to_string(gameId)];
const json& images = j.contains("data") ? j["data"] : j["images"];
if (images.is_array())
// No boxart
return;
json dataArray = images[std::to_string(gameId)];
std::string imagePath;
for (const auto& o : dataArray)
{