aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Files/Storage/Local.php
diff options
context:
space:
mode:
authorGit'Fellow <12234510+solracsf@users.noreply.github.com>2024-11-15 19:50:16 +0100
committerGit'Fellow <12234510+solracsf@users.noreply.github.com>2024-11-20 09:42:33 +0100
commit8755bf1815f0e7a76603026fa2d99c79abc7b273 (patch)
tree2dcaac43ccb39c5849db4cc5f37d7120feb5491b /lib/private/Files/Storage/Local.php
parenta4c1a75ee66005f6096461a3cbd2c0c9263ef1ca (diff)
downloadnextcloud-server-deleteExistingTarget.tar.gz
nextcloud-server-deleteExistingTarget.zip
fix(storage): Try to delete existing targetdeleteExistingTarget
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> Add same logic to common storage
Diffstat (limited to 'lib/private/Files/Storage/Local.php')
-rw-r--r--lib/private/Files/Storage/Local.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/private/Files/Storage/Local.php b/lib/private/Files/Storage/Local.php
index 6f645c74c11..f06e409cd8f 100644
--- a/lib/private/Files/Storage/Local.php
+++ b/lib/private/Files/Storage/Local.php
@@ -342,10 +342,12 @@ class Local extends \OC\Files\Storage\Common {
return false;
}
- if ($this->is_dir($target)) {
- $this->rmdir($target);
- } elseif ($this->is_file($target)) {
- $this->unlink($target);
+ if ($this->file_exists($target)) {
+ if ($this->is_dir($target)) {
+ $this->rmdir($target);
+ } elseif ($this->is_file($target)) {
+ $this->unlink($target);
+ }
}
if ($this->is_dir($source)) {