Skip to content

Commit

Permalink
Merge pull request #45591 from nextcloud/backport/45413/stable28
Browse files Browse the repository at this point in the history
[stable28] fix(files): Don't fail if dir exists
  • Loading branch information
solracsf authored May 31, 2024
2 parents 3bad181 + 4df77c6 commit d3b5db8
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 @@ -158,7 +158,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 d3b5db8

Please sign in to comment.