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());