add a couple null checks at multiselectors
This commit is contained in:
parent
a04d2d80b6
commit
124cf8960d
2 changed files with 3 additions and 3 deletions
|
@ -145,7 +145,7 @@ class DirectoryAdapter(val activity: SimpleActivity, var dirs: MutableList<Direc
|
|||
fun checkHideBtnVisibility(menu: Menu) {
|
||||
var hiddenCnt = 0
|
||||
var unhiddenCnt = 0
|
||||
selectedPositions.map { dirs[it].path }.forEach {
|
||||
selectedPositions.map { dirs.getOrNull(it)?.path }.filterNotNull().forEach {
|
||||
if (File(it).containsNoMedia())
|
||||
hiddenCnt++
|
||||
else
|
||||
|
@ -160,7 +160,7 @@ class DirectoryAdapter(val activity: SimpleActivity, var dirs: MutableList<Direc
|
|||
val pinnedFolders = config.pinnedFolders
|
||||
var pinnedCnt = 0
|
||||
var unpinnedCnt = 0
|
||||
selectedPositions.map { dirs[it].path }.forEach {
|
||||
selectedPositions.map { dirs.getOrNull(it)?.path }.filterNotNull().forEach {
|
||||
if (pinnedFolders.contains(it))
|
||||
pinnedCnt++
|
||||
else
|
||||
|
|
|
@ -140,7 +140,7 @@ class MediaAdapter(val activity: SimpleActivity, var media: MutableList<Medium>,
|
|||
fun checkHideBtnVisibility(menu: Menu) {
|
||||
var hiddenCnt = 0
|
||||
var unhiddenCnt = 0
|
||||
selectedPositions.map { media[it] }.forEach {
|
||||
selectedPositions.map { media.getOrNull(it) }.filterNotNull().forEach {
|
||||
if (it.name.startsWith('.'))
|
||||
hiddenCnt++
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue