From 9a557978c4fc195a6124db7e9095fa909c9ad655 Mon Sep 17 00:00:00 2001 From: Flyinghead Date: Sun, 26 Jun 2022 21:55:00 +0200 Subject: [PATCH] gamesdb: fix exception when boxart is missing --- core/rend/boxart/gamesdb.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/rend/boxart/gamesdb.cpp b/core/rend/boxart/gamesdb.cpp index 4964ee169..d3ba0342a 100644 --- a/core/rend/boxart/gamesdb.cpp +++ b/core/rend/boxart/gamesdb.cpp @@ -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) {