Skip to content

Build your personal knowledge base with Trilium Notes

server-ts: Fix regression

Elian Doran1372cc1cb9e8
diff --git a/src/routes/api/tree.ts b/src/routes/api/tree.ts
index 0dcb42e678..1b172f10bd 100644
--- a/src/routes/api/tree.ts
+++ b/src/routes/api/tree.ts
@@ -128,7 +128,7 @@ function getNotesAndBranchesAndAttributes(_noteIds: string[] | Set<string>) {
}
function getTree(req: Request) {
- const subTreeNoteId = req.query.subTreeNoteId === "string" ? req.query.subTreeNoteId : "" || 'root';
+ const subTreeNoteId = typeof req.query.subTreeNoteId === "string" ? req.query.subTreeNoteId : 'root';
const collectedNoteIds = new Set<string>([subTreeNoteId]);
function collect(parentNote: BNote) {