diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt index a7663f123..d28a14f79 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt @@ -573,7 +573,9 @@ fun Context.getCachedMedia(path: String, getVideosOnly: Boolean = false, getImag } } - mediumDao.deleteMedia(*mediaToDelete.toTypedArray()) + if (mediaToDelete.isNotEmpty()) { + mediumDao.deleteMedia(*mediaToDelete.toTypedArray()) + } }.start() }