Cancel the transfers of an account when the account is deleted, part 1
[pub/Android/ownCloud.git] / src / com / owncloud / android / operations / UploadFileOperation.java
index 1536a60..c144536 100644 (file)
@@ -400,7 +400,8 @@ public class UploadFileOperation extends RemoteOperation {
      * Checks if remotePath does not exist in the server and returns it, or adds
      * a suffix to it in order to avoid the server file is overwritten.
      * 
-     * @param string
+     * @param wc
+     * @param remotePath
      * @return
      */
     private String getAvailableRemotePath(OwnCloudClient wc, String remotePath) throws Exception {
@@ -442,6 +443,7 @@ public class UploadFileOperation extends RemoteOperation {
     }
     
     public void cancel() {
-        mUploadOperation.cancel();
+        if (mUploadOperation != null)
+            mUploadOperation.cancel();
     }
 }