From b94b803a40a7b11d8b0d83165b5ebfe6828796b3 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 4 Mar 2017 10:34:46 +0100 Subject: [PATCH] fix a crash when excluding folder without parents --- .../simplemobiletools/gallery/dialogs/ExcludeFolderDialog.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ExcludeFolderDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ExcludeFolderDialog.kt index 1cfeed52d..fe44f75f5 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ExcludeFolderDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ExcludeFolderDialog.kt @@ -44,7 +44,7 @@ class ExcludeFolderDialog(val activity: SimpleActivity, val selectedPaths: List< } private fun dialogConfirmed() { - val path = alternativePaths[radioGroup!!.checkedRadioButtonId] + val path = if (alternativePaths.isEmpty()) selectedPaths[0] else alternativePaths[radioGroup!!.checkedRadioButtonId] activity.config.addExcludedFolder(path) callback.invoke() }