aboutsummaryrefslogtreecommitdiff
path: root/backends/cloud/savessyncrequest.cpp
diff options
context:
space:
mode:
authorAlexander Tkachev2016-07-26 15:04:56 +0600
committerAlexander Tkachev2016-08-24 16:07:55 +0600
commitbb529e6fd0bcbd69f804c599c9d685181560a337 (patch)
treeedd812c4b685e935f11a896006f6368165cafc41 /backends/cloud/savessyncrequest.cpp
parentd5aca1f4fae400250b87d35e3517416dd4f26a8f (diff)
downloadscummvm-rg350-bb529e6fd0bcbd69f804c599c9d685181560a337.tar.gz
scummvm-rg350-bb529e6fd0bcbd69f804c599c9d685181560a337.tar.bz2
scummvm-rg350-bb529e6fd0bcbd69f804c599c9d685181560a337.zip
CLOUD: Update SavesSyncRequest
Add JSON checks in the callback.
Diffstat (limited to 'backends/cloud/savessyncrequest.cpp')
-rw-r--r--backends/cloud/savessyncrequest.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/backends/cloud/savessyncrequest.cpp b/backends/cloud/savessyncrequest.cpp
index 889c6b936b..9c487bb987 100644
--- a/backends/cloud/savessyncrequest.cpp
+++ b/backends/cloud/savessyncrequest.cpp
@@ -22,6 +22,8 @@
#include "backends/cloud/savessyncrequest.h"
#include "backends/cloud/cloudmanager.h"
+#include "backends/networking/curl/curljsonrequest.h"
+#include "backends/saves/default/default-saves.h"
#include "common/config-manager.h"
#include "common/debug.h"
#include "common/file.h"
@@ -29,7 +31,6 @@
#include "common/savefile.h"
#include "common/system.h"
#include "gui/saveload-dialog.h"
-#include <backends/saves/default/default-saves.h>
namespace Cloud {
@@ -152,7 +153,7 @@ void SavesSyncRequest::directoryListedErrorCallback(Networking::ErrorResponse er
Common::JSONObject object = value->asObject();
//Dropbox-related error:
- if (object.contains("error_summary")) {
+ if (Networking::CurlJsonRequest::jsonContainsString(object, "error_summary", "SavesSyncRequest", true)) {
Common::String summary = object.getVal("error_summary")->asString();
if (summary.contains("not_found")) {
irrecoverable = false;
@@ -160,9 +161,9 @@ void SavesSyncRequest::directoryListedErrorCallback(Networking::ErrorResponse er
}
//OneDrive-related error:
- if (object.contains("error") && object.getVal("error")->isObject()) {
+ if (Networking::CurlJsonRequest::jsonContainsObject(object, "error", "SavesSyncRequest", true)) {
Common::JSONObject errorNode = object.getVal("error")->asObject();
- if (errorNode.contains("code") && errorNode.contains("message")) {
+ if (Networking::CurlJsonRequest::jsonContainsString(errorNode, "code", "SavesSyncRequest")) {
Common::String code = errorNode.getVal("code")->asString();
if (code == "itemNotFound") {
irrecoverable = false;