Skip to content

Commit 099f22d

Browse files
authored
Merge pull request #1263 from nextcloud/fix/shared-folder-check
fix: Shared folder check
2 parents 35d9a45 + 25ad4e6 commit 099f22d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/Service/NoteUtil.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,14 +168,15 @@ public function getOrCreateFolder(string $path, bool $create = true) : Folder {
168168
$folder = $this->root->newFolder($path);
169169
}
170170

171+
if (!($folder instanceof Folder)) {
172+
throw new NotesFolderException($path.' is not a folder');
173+
}
174+
171175
if ($folder->isShared()) {
172176
$folderName = $this->root->getNonExistingName($path);
173177
$folder = $this->root->newFolder($folderName);
174178
}
175179

176-
if (!($folder instanceof Folder)) {
177-
throw new NotesFolderException($path.' is not a folder');
178-
}
179180
return $folder;
180181
}
181182

0 commit comments

Comments
 (0)