fix(files): Try to create dir only if it not exists

Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
pull/45413/head
Git'Fellow 2024-05-21 09:38:47 +07:00 committed by Louis
parent 31b0a44cf6
commit 5c4e4c5590
1 changed files with 1 additions and 1 deletions

@ -133,7 +133,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;