瀏覽代碼

fix dodgy code

Signed-off-by: Jonas Mayer <jonas.a.mayer@gmx.net>
Jonas Mayer 1 年之前
父節點
當前提交
322565f099
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      app/src/main/java/com/owncloud/android/files/services/FileUploader.java

+ 2 - 2
app/src/main/java/com/owncloud/android/files/services/FileUploader.java

@@ -1447,10 +1447,10 @@ public class FileUploader extends Service
             mNotificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
         }
 
-        if (uploadFileOperation == null) return;
+        if (uploadFileOperation == null || uploadFileOperation.getOldFile() == null) return;
         //cancel for old file because of file conflicts
         mNotificationManager.cancel(NotificationUtils.createUploadNotificationTag(uploadFileOperation.getOldFile()),
-                                   NOTIFICATION_ERROR_ID);
+                                    NOTIFICATION_ERROR_ID);
         mNotificationManager.cancel(NotificationUtils.createUploadNotificationTag(uploadFileOperation.getFile()),
                                    NOTIFICATION_ERROR_ID);
     }