From 5326d08aeb55c39f6439872eeb21e7e7d86ed54d Mon Sep 17 00:00:00 2001 From: Jonas Mayer Date: Thu, 7 Dec 2023 00:21:15 +0100 Subject: [PATCH] hopefully really fix dodgy code Signed-off-by: Jonas Mayer --- .../android/files/services/FileUploader.java | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/owncloud/android/files/services/FileUploader.java b/app/src/main/java/com/owncloud/android/files/services/FileUploader.java index 895a020ec5..8b38441b85 100644 --- a/app/src/main/java/com/owncloud/android/files/services/FileUploader.java +++ b/app/src/main/java/com/owncloud/android/files/services/FileUploader.java @@ -1447,12 +1447,19 @@ public class FileUploader extends Service mNotificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE); } - if (uploadFileOperation == null || uploadFileOperation.getOldFile() == null) return; - //cancel for old file because of file conflicts - mNotificationManager.cancel(NotificationUtils.createUploadNotificationTag(uploadFileOperation.getOldFile()), - NOTIFICATION_ERROR_ID); + if (uploadFileOperation == null) return; + mNotificationManager.cancel(NotificationUtils.createUploadNotificationTag(uploadFileOperation.getFile()), - NOTIFICATION_ERROR_ID); + NOTIFICATION_ERROR_ID); + + //cancel for old file because of file conflicts + OCFile oldFile = uploadFileOperation.getOldFile(); + if ( oldFile != null) { + mNotificationManager.cancel(NotificationUtils.createUploadNotificationTag(oldFile), + NOTIFICATION_ERROR_ID); + } + + }