Check that product id selection was successful in Downloader::downloadFileWithId

Fixes possible issue where downloader tries to get product info even though it failed to get valid product id beforehand
This commit is contained in:
Sude 2020-04-08 09:41:21 +03:00
parent d6c226c5d7
commit 4997a45597

View File

@ -2384,13 +2384,12 @@ int Downloader::downloadFileWithId(const std::string& fileid_string, const std::
fileid.assign(fileid_string.begin()+pos+1, fileid_string.end());
std::string product_id;
if(this->galaxySelectProductIdHelper(gamename, product_id))
bool bSelectOK = this->galaxySelectProductIdHelper(gamename, product_id);
if (!bSelectOK || product_id.empty())
{
if (product_id.empty())
{
std::cerr << "Failed to get numerical product id" << std::endl;
return 1;
}
std::cerr << "Failed to get numerical product id" << std::endl;
return 1;
}
Json::Value productInfo = gogGalaxy->getProductInfo(product_id);