From 59247b1c4f4a856a63a5bc8d6cfe1e2a8f423f21 Mon Sep 17 00:00:00 2001 From: zvon Date: Sun, 9 Feb 2020 16:57:12 +0100 Subject: [PATCH] Test if 'data' exists in json file --- tv_rename.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tv_rename.cpp b/tv_rename.cpp index 4ca59df..0f3e15a 100644 --- a/tv_rename.cpp +++ b/tv_rename.cpp @@ -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"];