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 4237638aa..cdaf426c9 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt @@ -135,7 +135,8 @@ class DirectoryAdapter(val activity: SimpleActivity, val dirs: MutableList, override fun onDestroyActionMode(actionMode: ActionMode?) { super.onDestroyActionMode(actionMode) selectedPositions.forEach { - getProperView(itemViews[it]!!).isSelected = false + if (itemViews[it] != null) + getProperView(itemViews[it]!!).isSelected = false } selectedPositions.clear() actMode = null