Skip to content

Commit

Permalink
fix: catch exception when getting notes folder
Browse files Browse the repository at this point in the history
Signed-off-by: Cleopatra Enjeck M. <[email protected]>
  • Loading branch information
enjeck committed Feb 19, 2025
1 parent 15c2df6 commit 227fa17
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/Service/NoteUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

Expand Down

0 comments on commit 227fa17

Please sign in to comment.