diff --git a/lib/Service/NoteUtil.php b/lib/Service/NoteUtil.php index 6cb52711b..2bf85f132 100644 --- a/lib/Service/NoteUtil.php +++ b/lib/Service/NoteUtil.php @@ -186,7 +186,12 @@ public function getOrCreateFolder(string $path, bool $create = true) : Folder { public function getNotesFolderUserPath(string $userId): ?string { /** @psalm-suppress MissingDependency */ $userFolder = $this->getRoot()->getUserFolder($userId); - $nodesFolder = $this->getOrCreateNotesFolder($userId, false); + try { + $nodesFolder = $this->getOrCreateNotesFolder($userId, false); + } catch (NotesFolderException $e) { + $this->util->logger->error("Failed to get notes folder for user $userId: " . $e->getMessage()); + return null; + } return $userFolder->getRelativePath($nodesFolder->getPath()); }