diff options
Diffstat (limited to 'backends/cloud/onedrive/onedrivecreatedirectoryrequest.cpp')
-rw-r--r-- | backends/cloud/onedrive/onedrivecreatedirectoryrequest.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/backends/cloud/onedrive/onedrivecreatedirectoryrequest.cpp b/backends/cloud/onedrive/onedrivecreatedirectoryrequest.cpp index 4d6d8fceda..fc7e4f58b0 100644 --- a/backends/cloud/onedrive/onedrivecreatedirectoryrequest.cpp +++ b/backends/cloud/onedrive/onedrivecreatedirectoryrequest.cpp @@ -101,12 +101,19 @@ void OneDriveCreateDirectoryRequest::responseCallback(Networking::JsonResponse r if (rq && rq->getNetworkReadStream()) error.httpResponseCode = rq->getNetworkReadStream()->httpResponseCode(); - if (!json) { - warning("OneDriveCreateDirectoryRequest: NULL passed instead of JSON"); + if (json == nullptr) { + error.response = "Failed to parse JSON, null passed!"; finishError(error); return; } + if (!json->isObject()) { + error.response = "Passed JSON is not an object!"; + finishError(error); + delete json; + return; + } + Common::JSONObject info = json->asObject(); if (info.contains("id")) { finishCreation(true); |