From 9c31b8d01e3db2ea6d2d84e4e5ce6d4039809dd0 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 1 Mar 2020 22:38:57 +0100 Subject: [PATCH] adding a null check at checking invalid folders --- .../simplemobiletools/gallery/pro/activities/MainActivity.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt index 6fcefb89a..c5d929a84 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt @@ -1155,7 +1155,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { } else if (it.path != config.tempFolderPath) { val children = if (isPathOnOTG(it.path)) getOTGFolderChildrenNames(it.path) else File(it.path).list()?.asList() val hasMediaFile = children?.any { - it?.isMediaFile() == true || (File(it!!).isDirectory && it.startsWith("img_", true)) + it != null && (it.isMediaFile() || (File(it).isDirectory && it.startsWith("img_", true))) } ?: false if (!hasMediaFile) {