Test if 'data' exists in json file

This commit is contained in:
zvon 2020-02-09 16:57:12 +01:00
parent 1e486dbbf6
commit 59247b1c4f

View File

@ -138,6 +138,8 @@ std::vector< string > getEpisodeNames( const string &id, const string &season,
json.Parse( request.get( baseurl + page ).c_str() );
if ( json.HasParseError() )
return {};
if( json.FindMember("data") == json.MemberEnd() )
break;
if ( json["data"].IsArray() ) {
rapidjson::Value &epdata = json["data"];