Fix "Type is not convertible to string" error in Downloader::getGames

On some systems the integer to string conversion caused std::runtime_error "Type is not convertible to string"
This commit is contained in:
Sude 2015-05-12 22:04:36 +03:00
parent 8c1ee17d4b
commit 5af5a286e7

View File

@ -2074,7 +2074,7 @@ std::vector<gameItem> Downloader::getGames()
Json::Value product = root["products"][i];
gameItem game;
game.name = product["slug"].asString();
game.id = product["id"].asString();
game.id = product["id"].isInt() ? std::to_string(product["id"].asInt()) : product["id"].asString();
unsigned int platform = 0;
if (product["worksOn"]["Windows"].asBool())