ソースを参照

fix dodgy code

Signed-off-by: Jonas Mayer <jonas.a.mayer@gmx.net>
Jonas Mayer 1 年間 前
コミット
322565f099

+ 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);
             mNotificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
         }
         }
 
 
-        if (uploadFileOperation == null) return;
+        if (uploadFileOperation == null || uploadFileOperation.getOldFile() == null) return;
         //cancel for old file because of file conflicts
         //cancel for old file because of file conflicts
         mNotificationManager.cancel(NotificationUtils.createUploadNotificationTag(uploadFileOperation.getOldFile()),
         mNotificationManager.cancel(NotificationUtils.createUploadNotificationTag(uploadFileOperation.getOldFile()),
-                                   NOTIFICATION_ERROR_ID);
+                                    NOTIFICATION_ERROR_ID);
         mNotificationManager.cancel(NotificationUtils.createUploadNotificationTag(uploadFileOperation.getFile()),
         mNotificationManager.cancel(NotificationUtils.createUploadNotificationTag(uploadFileOperation.getFile()),
                                    NOTIFICATION_ERROR_ID);
                                    NOTIFICATION_ERROR_ID);
     }
     }