Skip to content

Commit

Permalink
Try create folder first and check if it exists after
Browse files Browse the repository at this point in the history
Co-authored-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
  • Loading branch information
solracsf and Altahrim authored May 22, 2024
1 parent b1a4428 commit 7420d89
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->is_dir($fullPath) && !$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 7420d89

Please sign in to comment.