From e6a7d124fc40eb44f35c17be07f72b61b76c8466 Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Fri, 18 Dec 2020 07:55:48 +0100 Subject: [PATCH] If path is not set or empty do not run any media scanner Signed-off-by: tobiasKaminsky --- .../owncloud/android/datamodel/FileDataStorageManager.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/owncloud/android/datamodel/FileDataStorageManager.java b/src/main/java/com/owncloud/android/datamodel/FileDataStorageManager.java index 4e688a8f02b7..11dabb47acda 100644 --- a/src/main/java/com/owncloud/android/datamodel/FileDataStorageManager.java +++ b/src/main/java/com/owncloud/android/datamodel/FileDataStorageManager.java @@ -1718,10 +1718,10 @@ public static void triggerMediaScan(String path) { } public static void triggerMediaScan(String path, OCFile file) { - if (path != null) { + if (path != null && !TextUtils.isEmpty(path)) { ContentValues values = new ContentValues(); ContentResolver contentResolver = MainApp.getAppContext().getContentResolver(); - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q && !TextUtils.isEmpty(path)) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q ) { if (file != null) { values.put(MediaStore.Images.Media.MIME_TYPE, file.getMimeType()); values.put(MediaStore.Images.Media.TITLE, file.getFileName());