From 9e788d945399f58e2a80e19b89c168d01efab092 Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 19 May 2017 20:30:35 +0200 Subject: [PATCH] add some null checks to deselecting items --- .../com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt | 3 ++- .../com/simplemobiletools/gallery/adapters/MediaAdapter.kt | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) 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