Browse Source

Check if upload operation is null

Signed-off-by: Mario Danic <mario@lovelyhq.com>
Mario Danic 7 years ago
parent
commit
3c10dfedfd

+ 1 - 2
src/main/java/com/owncloud/android/operations/UploadFileOperation.java

@@ -422,7 +422,6 @@ public class UploadFileOperation extends SyncOperation {
                         fileLock = channel.tryLock();
                         fileLock = channel.tryLock();
                     } else {
                     } else {
                         result = new RemoteOperationResult(ResultCode.LOCK_FAILED);
                         result = new RemoteOperationResult(ResultCode.LOCK_FAILED);
-
                     }
                     }
                 }
                 }
             }
             }
@@ -489,7 +488,7 @@ public class UploadFileOperation extends SyncOperation {
                 throw new OperationCancelledException();
                 throw new OperationCancelledException();
             }
             }
 
 
-            if (result == null || result.isSuccess()) {
+            if (result == null || result.isSuccess() && mUploadOperation != null) {
                 result = mUploadOperation.execute(client);
                 result = mUploadOperation.execute(client);
 
 
                 /// move local temporal file or original file to its corresponding
                 /// move local temporal file or original file to its corresponding