]> source.dussan.org Git - nextcloud-server.git/commitdiff
take return of mkdir into account, throw exception on failure
authorArthur Schiwon <blizzz@arthur-schiwon.de>
Mon, 29 Apr 2019 14:12:01 +0000 (16:12 +0200)
committerArthur Schiwon <blizzz@arthur-schiwon.de>
Mon, 29 Apr 2019 14:45:59 +0000 (16:45 +0200)
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
lib/private/Files/Node/Folder.php

index a9b443ce52e77b402ec2b54066f960384a226013..ebf67e47a2173ba22295ea7317ae7a57bed6ebad 100644 (file)
@@ -158,7 +158,9 @@ class Folder extends Node implements \OCP\Files\Folder {
                        $nonExisting = new NonExistingFolder($this->root, $this->view, $fullPath);
                        $this->root->emit('\OC\Files', 'preWrite', array($nonExisting));
                        $this->root->emit('\OC\Files', 'preCreate', array($nonExisting));
-                       $this->view->mkdir($fullPath);
+                       if(!$this->view->mkdir($fullPath)) {
+                               throw new NotPermittedException('Could not create folder');
+                       }
                        $node = new Folder($this->root, $this->view, $fullPath);
                        $this->root->emit('\OC\Files', 'postWrite', array($node));
                        $this->root->emit('\OC\Files', 'postCreate', array($node));