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 0bb214d3e..860316b9b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt @@ -331,7 +331,9 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList { val selectedMedia = ArrayList(selectedPositions.size) selectedPositions.forEach { - selectedMedia.add(media[it] as Medium) + (media.getOrNull(it) as? Medium)?.apply { + selectedMedia.add(this) + } } return selectedMedia }