Check if json has serials node and check if it is empty

Fixes downloader creating serials.txt even if the game didn't have any serials
This commit is contained in:
Sude 2015-05-13 15:04:49 +03:00
parent 5af5a286e7
commit 3e0c36beb5

View File

@ -2243,7 +2243,14 @@ std::string Downloader::getSerialsFromJSON(const Json::Value& json)
{
std::ostringstream serials;
if (!json.isMember("cdKey"))
return std::string();
std::string cdkey = json["cdKey"].asString();
if (cdkey.empty())
return std::string();
if (cdkey.find("<span>") == std::string::npos)
{
serials << cdkey << std::endl;