From 81f543f792dbdeedef6001b6b2ffa2c05cf850eb Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 11 Dec 2016 22:33:26 +0100 Subject: [PATCH] add a directory check at renaming --- .../simplemobiletools/gallery/dialogs/RenameDirectoryDialog.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/RenameDirectoryDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/RenameDirectoryDialog.kt index 65b25669f..916d4590a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/RenameDirectoryDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/RenameDirectoryDialog.kt @@ -69,7 +69,7 @@ class RenameDirectoryDialog(val activity: SimpleActivity, val dir: File, val cal private fun sendSuccess(updatedFiles: ArrayList, newDir: File) { activity.toast(R.string.renaming_folder) - val files = newDir.listFiles() + val files = if (newDir.isDirectory) newDir.listFiles() else arrayOf() files.mapTo(updatedFiles) { it.absolutePath } updatedFiles.add(newDir.absolutePath)