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

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