aboutsummaryrefslogtreecommitdiff
path: root/backends/cloud
diff options
context:
space:
mode:
authorAlexander Tkachev2016-07-20 12:45:49 +0600
committerAlexander Tkachev2016-08-24 16:07:55 +0600
commitab0f2d1a03c9ca45dd30440b8a897d9de480bfbe (patch)
tree30d01393ff5f6841ef601d3884656c94ecbb3b85 /backends/cloud
parent6753c18d6f182f98db0fe9403991392482d7a9fa (diff)
downloadscummvm-rg350-ab0f2d1a03c9ca45dd30440b8a897d9de480bfbe.tar.gz
scummvm-rg350-ab0f2d1a03c9ca45dd30440b8a897d9de480bfbe.tar.bz2
scummvm-rg350-ab0f2d1a03c9ca45dd30440b8a897d9de480bfbe.zip
CLOUD: Fix OneDriveUploadRequest
Segfault when given stream is nullptr.
Diffstat (limited to 'backends/cloud')
-rw-r--r--backends/cloud/onedrive/onedriveuploadrequest.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/backends/cloud/onedrive/onedriveuploadrequest.cpp b/backends/cloud/onedrive/onedriveuploadrequest.cpp
index 55359f83e7..5b86c6c988 100644
--- a/backends/cloud/onedrive/onedriveuploadrequest.cpp
+++ b/backends/cloud/onedrive/onedriveuploadrequest.cpp
@@ -50,9 +50,15 @@ OneDriveUploadRequest::~OneDriveUploadRequest() {
void OneDriveUploadRequest::start() {
_ignoreCallback = true;
if (_workingRequest) _workingRequest->finish();
+ if (_contentsStream == nullptr) {
+ warning("OneDriveUploadRequest: cannot restart because no stream given");
+ finishError(Networking::ErrorResponse(this, false, true, "No stream given", -1));
+ return;
+ }
if (!_contentsStream->seek(0)) {
warning("OneDriveUploadRequest: cannot restart because stream couldn't seek(0)");
finishError(Networking::ErrorResponse(this, false, true, "", -1));
+ return;
}
_ignoreCallback = false;