CLOUD: Fix Dropbox and Google Drive UploadRequests

Possible segfault there too.
This commit is contained in:
Alexander Tkachev 2016-07-20 12:48:14 +06:00
parent ab0f2d1a03
commit 1d78d20fcf
2 changed files with 3 additions and 1 deletions

View file

@ -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;

View file

@ -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