Fixed crash when TheGamesDB scraper sees a platform it doesn't support.

This commit is contained in:
Aloshi 2014-06-03 12:09:50 -05:00
parent f7f51c5702
commit 40ca44e54f

View file

@ -73,8 +73,14 @@ std::unique_ptr<ScraperSearchHandle> GamesDBScraper::getResultsAsync(const Scrap
if(params.system->getPlatformId() != PLATFORM_UNKNOWN) if(params.system->getPlatformId() != PLATFORM_UNKNOWN)
{ {
path += "&platform="; auto platformIt = gamesdb_platformid_map.find(params.system->getPlatformId());
path += HttpReq::urlEncode(gamesdb_platformid_map.at(params.system->getPlatformId())); if(platformIt != gamesdb_platformid_map.end())
{
path += "&platform=";
path += HttpReq::urlEncode(platformIt->second);
}else{
LOG(LogWarning) << "TheGamesDB scraper warning - no support for platform " << getPlatformName(params.system->getPlatformId());
}
} }
path = "thegamesdb.net" + path; path = "thegamesdb.net" + path;