From 597ffd5a575b0399af00010cd3caac9a4feb0fba Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 15 Mar 2017 22:12:28 +0100 Subject: [PATCH] check if the destination file exists at move --- .../kotlin/com/simplemobiletools/gallery/dialogs/CopyDialog.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/CopyDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/CopyDialog.kt index abf8a97d4..49a9a6a15 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/CopyDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/CopyDialog.kt @@ -78,7 +78,7 @@ class CopyDialog(val activity: SimpleActivity, val files: ArrayList, val c updatedFiles.addAll(files) for (file in files) { val destination = File(destinationDir, file.name) - if (file.renameTo(destination)) + if (!destination.exists() && file.renameTo(destination)) updatedFiles.add(destination) }