Skip to content

Commit ec92ea1

Browse files
committed
fix: catch exception when getting notes folder
Signed-off-by: Cleopatra Enjeck M. <[email protected]>
1 parent 4c2f2d0 commit ec92ea1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/Service/NoteUtil.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,12 @@ public function getOrCreateFolder(string $path, bool $create = true) : Folder {
186186
public function getNotesFolderUserPath(string $userId): ?string {
187187
/** @psalm-suppress MissingDependency */
188188
$userFolder = $this->getRoot()->getUserFolder($userId);
189-
$nodesFolder = $this->getOrCreateNotesFolder($userId, false);
189+
try {
190+
$nodesFolder = $this->getOrCreateNotesFolder($userId, false);
191+
} catch (NotesFolderException $e) {
192+
$this->util->logger->error("Failed to get notes folder for user $userId: " . $e->getMessage());
193+
return null;
194+
}
190195
return $userFolder->getRelativePath($nodesFolder->getPath());
191196
}
192197

0 commit comments

Comments
 (0)