add null checks at toggleItemSelection of adapters
This commit is contained in:
parent
178c92c993
commit
7fa71c5302
2 changed files with 2 additions and 2 deletions
|
@ -40,7 +40,7 @@ class DirectoryAdapter(val activity: SimpleActivity, var dirs: MutableList<Direc
|
|||
|
||||
fun toggleItemSelection(select: Boolean, pos: Int) {
|
||||
if (select) {
|
||||
itemViews[pos].dir_check.background.setColorFilter(primaryColor, PorterDuff.Mode.SRC_IN)
|
||||
itemViews[pos]?.dir_check?.background?.setColorFilter(primaryColor, PorterDuff.Mode.SRC_IN)
|
||||
selectedPositions.add(pos)
|
||||
} else
|
||||
selectedPositions.remove(pos)
|
||||
|
|
|
@ -37,7 +37,7 @@ class MediaAdapter(val activity: SimpleActivity, var media: MutableList<Medium>,
|
|||
|
||||
fun toggleItemSelection(select: Boolean, pos: Int) {
|
||||
if (select) {
|
||||
itemViews[pos].medium_check.background.setColorFilter(primaryColor, PorterDuff.Mode.SRC_IN)
|
||||
itemViews[pos]?.medium_check?.background?.setColorFilter(primaryColor, PorterDuff.Mode.SRC_IN)
|
||||
selectedPositions.add(pos)
|
||||
} else
|
||||
selectedPositions.remove(pos)
|
||||
|
|
Loading…
Reference in a new issue