Skip to content

Commit

Permalink
Merge pull request #45413 from nextcloud/createIfNotExists
Browse files Browse the repository at this point in the history
fix(files): Try to create dir only if it not exists
  • Loading branch information
susnux committed May 30, 2024
2 parents 2d62b0a + 77979b1 commit 48e6240
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/private/Files/Node/Folder.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public function newFolder($path) {
$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->mkdir($fullPath) && !$this->view->is_dir($fullPath)) {
throw new NotPermittedException('Could not create folder "' . $fullPath . '"');
}
$parent = dirname($fullPath) === $this->getPath() ? $this : null;
Expand Down

0 comments on commit 48e6240

Please sign in to comment.