diff options
author | Alexander Tkachev | 2016-07-20 12:48:14 +0600 |
---|---|---|
committer | Alexander Tkachev | 2016-08-24 16:07:55 +0600 |
commit | 1d78d20fcf59d772688f9f32d81670548d6569f9 (patch) | |
tree | 845e9f6a75e3c5c4aee043dd795fcf864927ffe5 | |
parent | ab0f2d1a03c9ca45dd30440b8a897d9de480bfbe (diff) | |
download | scummvm-rg350-1d78d20fcf59d772688f9f32d81670548d6569f9.tar.gz scummvm-rg350-1d78d20fcf59d772688f9f32d81670548d6569f9.tar.bz2 scummvm-rg350-1d78d20fcf59d772688f9f32d81670548d6569f9.zip |
CLOUD: Fix Dropbox and Google Drive UploadRequests
Possible segfault there too.
-rw-r--r-- | backends/cloud/dropbox/dropboxuploadrequest.cpp | 1 | ||||
-rw-r--r-- | backends/cloud/googledrive/googledriveuploadrequest.cpp | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/backends/cloud/dropbox/dropboxuploadrequest.cpp b/backends/cloud/dropbox/dropboxuploadrequest.cpp index e530502413..a3d7dd0d6d 100644 --- a/backends/cloud/dropbox/dropboxuploadrequest.cpp +++ b/backends/cloud/dropbox/dropboxuploadrequest.cpp @@ -56,6 +56,7 @@ void DropboxUploadRequest::start() { if (!_contentsStream->seek(0)) { warning("DropboxUploadRequest: cannot restart because stream couldn't seek(0)"); finishError(Networking::ErrorResponse(this, false, true, "", -1)); + return; } _ignoreCallback = false; diff --git a/backends/cloud/googledrive/googledriveuploadrequest.cpp b/backends/cloud/googledrive/googledriveuploadrequest.cpp index ce7d59a50c..73a7fbfcac 100644 --- a/backends/cloud/googledrive/googledriveuploadrequest.cpp +++ b/backends/cloud/googledrive/googledriveuploadrequest.cpp @@ -50,9 +50,10 @@ GoogleDriveUploadRequest::~GoogleDriveUploadRequest() { void GoogleDriveUploadRequest::start() { _ignoreCallback = true; if (_workingRequest) _workingRequest->finish(); - if (!_contentsStream->seek(0)) { + if (_contentsStream == nullptr || !_contentsStream->seek(0)) { warning("GoogleDriveUploadRequest: cannot restart because stream couldn't seek(0)"); finishError(Networking::ErrorResponse(this, false, true, "", -1)); + return; } _resolvedId = ""; //used to update file contents _parentId = ""; //used to create file within parent directory |