mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2025-01-18 14:28:00 +01:00
check if the destination file exists at move
This commit is contained in:
parent
9f91e14a32
commit
597ffd5a57
1 changed files with 1 additions and 1 deletions
|
@ -78,7 +78,7 @@ class CopyDialog(val activity: SimpleActivity, val files: ArrayList<File>, val c
|
||||||
updatedFiles.addAll(files)
|
updatedFiles.addAll(files)
|
||||||
for (file in files) {
|
for (file in files) {
|
||||||
val destination = File(destinationDir, file.name)
|
val destination = File(destinationDir, file.name)
|
||||||
if (file.renameTo(destination))
|
if (!destination.exists() && file.renameTo(destination))
|
||||||
updatedFiles.add(destination)
|
updatedFiles.add(destination)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue