From aa91b0ab3cf59fd2f6ae2b865fd62059b803b145 Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Mon, 29 Apr 2019 16:12:01 +0200 Subject: [PATCH] take return of mkdir into account, throw exception on failure Signed-off-by: Arthur Schiwon --- lib/private/Files/Node/Folder.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/private/Files/Node/Folder.php b/lib/private/Files/Node/Folder.php index a9b443ce52..ebf67e47a2 100644 --- a/lib/private/Files/Node/Folder.php +++ b/lib/private/Files/Node/Folder.php @@ -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));