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 f2f896a1d..fb2a6e2d9 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt @@ -230,6 +230,9 @@ class MediaAdapter(val activity: SimpleActivity, var media: MutableList, private fun getCurrentFile() = File(media[selectedPositions.first()].path) private fun deleteFiles() { + if (selectedPositions.isEmpty()) + return + val files = ArrayList(selectedPositions.size) val removeMedia = ArrayList(selectedPositions.size)