diff --git a/app/src/main/kotlin/com/simplemobiletools/filemanager/dialogs/CopyDialog.kt b/app/src/main/kotlin/com/simplemobiletools/filemanager/dialogs/CopyDialog.kt index 7b7de686..58af1e2e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/dialogs/CopyDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/dialogs/CopyDialog.kt @@ -66,14 +66,16 @@ class CopyDialog(val activity: Activity, val files: List, val path: String CopyTask(copyListener, mContext).execute(pair) dismiss() } else { - for (f in files) { - val destination = File(destinationDir, f.name) - f.renameTo(destination) - context.rescanItem(destination) - } + if (Utils.isPathOnSD(context, view.source.value) && Utils.isPathOnSD(context, destinationPath)) { + for (f in files) { + val destination = File(destinationDir, f.name) + f.renameTo(destination) + context.rescanItem(destination) + } - dismiss() - listener.onSuccess() + dismiss() + listener.onSuccess() + } } }) }