Skip to content

Commit 24090ca

Browse files
committed
fix: check response status before parsing JSON in init request
1 parent e086082 commit 24090ca

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

source/gameanalytics/GAHTTPApi.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,6 @@ namespace gameanalytics
9898
// process the response
9999
logging::GALogger::d("init request content: %.*s, json: %s", (int)content.size(), content.data(), jsonString.c_str());
100100

101-
json requestJsonDict = json::parse(content);
102-
103101
EGAHTTPApiResponse requestResponseEnum = processRequestResponse(response, "Init");
104102

105103
// if not 200 result
@@ -110,6 +108,7 @@ namespace gameanalytics
110108
return requestResponseEnum;
111109
}
112110

111+
json requestJsonDict = json::parse(content);
113112
if (requestJsonDict.is_null())
114113
{
115114
logging::GALogger::d("Failed Init Call. Json decoding failed");

0 commit comments

Comments
 (0)