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 8de0bfadb..ebc2f1f5a 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 @@ -546,7 +546,13 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { val fileDirItems = folders.asSequence().filter { it.isDirectory }.map { FileDirItem(it.absolutePath, it.name, true) }.toMutableList() as ArrayList when { fileDirItems.isEmpty() -> return - fileDirItems.size == 1 -> toast(String.format(getString(R.string.deleting_folder), fileDirItems.first().name)) + fileDirItems.size == 1 -> { + try { + toast(String.format(getString(R.string.deleting_folder), fileDirItems.first().name)) + } catch (e: Exception) { + showErrorToast(e) + } + } else -> { val baseString = if (config.useRecycleBin) R.plurals.moving_items_into_bin else R.plurals.delete_items val deletingItems = resources.getQuantityString(baseString, fileDirItems.size, fileDirItems.size)