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() }