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 <[email protected]>
Signed-off-by: Git'Fellow <[email protected]>
  • Loading branch information
2 people authored and artonge committed May 30, 2024
1 parent 5c4e4c5 commit 77979b1
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->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 77979b1

Please sign in to comment.