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)