From: Git'Fellow <12234510+solracsf@users.noreply.github.com> Date: Tue, 21 May 2024 07:38:47 +0000 (+0200) Subject: fix(files): Try to create dir only if it not exists X-Git-Tag: v29.0.3rc1~44^2~1 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=75883cb4d94251cc56bc2f270f9ac9ef538088ba;p=nextcloud-server.git fix(files): Try to create dir only if it not exists Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> --- diff --git a/lib/private/Files/Node/Folder.php b/lib/private/Files/Node/Folder.php index 52e7b55676a..cecc6d39a09 100644 --- a/lib/private/Files/Node/Folder.php +++ b/lib/private/Files/Node/Folder.php @@ -158,7 +158,7 @@ class Folder extends Node implements \OCP\Files\Folder { $fullPath = $this->getFullPath($path); $nonExisting = new NonExistingFolder($this->root, $this->view, $fullPath); $this->sendHooks(['preWrite', 'preCreate'], [$nonExisting]); - if (!$this->view->mkdir($fullPath)) { + if (!$this->view->is_dir($fullPath) && !$this->view->mkdir($fullPath)) { throw new NotPermittedException('Could not create folder "' . $fullPath . '"'); } $parent = dirname($fullPath) === $this->getPath() ? $this : null;