From 124cf8960dffc155665885742e7252bbc7454396 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 28 May 2017 23:37:12 +0200 Subject: [PATCH] add a couple null checks at multiselectors --- .../simplemobiletools/gallery/adapters/DirectoryAdapter.kt | 4 ++-- .../com/simplemobiletools/gallery/adapters/MediaAdapter.kt | 2 +- 2 files changed, 3 insertions(+), 3 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 2acc9dd99..4a5876a18 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt @@ -145,7 +145,7 @@ class DirectoryAdapter(val activity: SimpleActivity, var dirs: MutableList, 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