Skip to content

Commit

Permalink
Merge pull request #1486 from nextcloud/catch-folder-exception
Browse files Browse the repository at this point in the history
fix: catch exception when getting notes folder
  • Loading branch information
enjeck authored Feb 20, 2025
2 parents 33c3f78 + 2385a9b commit 1eb2a4b
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->warning("Failed to get notes folder for user $userId: " . $e->getMessage());
return null;
}
return $userFolder->getRelativePath($nodesFolder->getPath());
}

Expand Down

0 comments on commit 1eb2a4b

Please sign in to comment.