From f0736fe634f4ef749136786fc84ae2d15bd37fcd Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 4 May 2020 10:17:17 +0200 Subject: [PATCH] show an error at deleting a folder exception, to see what is wrong there --- .../gallery/pro/activities/MainActivity.kt | 8 +++++++- 1 file changed, 7 insertions(+), 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 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)