diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt index cc3bde953..91d11445d 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt @@ -239,6 +239,10 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: MutableList(selectedPositions.size) val removeFolders = ArrayList(selectedPositions.size) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt index 7c599a9b0..4a7c2a5c2 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt @@ -215,6 +215,10 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList, private fun getCurrentPath() = media[selectedPositions.first()].path private fun deleteFiles() { + if (selectedPositions.isEmpty()) { + return + } + val fileDirItems = ArrayList(selectedPositions.size) val removeMedia = ArrayList(selectedPositions.size)