add some null checks to deselecting items

This commit is contained in:
tibbi 2017-05-19 20:30:35 +02:00
parent e086ac134f
commit 9e788d9453
2 changed files with 4 additions and 2 deletions

View file

@ -135,6 +135,7 @@ class DirectoryAdapter(val activity: SimpleActivity, val dirs: MutableList<Direc
override fun onDestroyActionMode(actionMode: ActionMode?) { override fun onDestroyActionMode(actionMode: ActionMode?) {
super.onDestroyActionMode(actionMode) super.onDestroyActionMode(actionMode)
selectedPositions.forEach { selectedPositions.forEach {
if (itemViews[it] != null)
getProperView(itemViews[it]!!).isSelected = false getProperView(itemViews[it]!!).isSelected = false
} }
selectedPositions.clear() selectedPositions.clear()

View file

@ -130,6 +130,7 @@ class MediaAdapter(val activity: SimpleActivity, var media: MutableList<Medium>,
override fun onDestroyActionMode(actionMode: ActionMode?) { override fun onDestroyActionMode(actionMode: ActionMode?) {
super.onDestroyActionMode(actionMode) super.onDestroyActionMode(actionMode)
selectedPositions.forEach { selectedPositions.forEach {
if (itemViews[it] != null)
getProperView(itemViews[it]!!).isSelected = false getProperView(itemViews[it]!!).isSelected = false
} }
selectedPositions.clear() selectedPositions.clear()