From d47a8ffe02126aa30e37d148eb3f0cbee2ad8b05 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Thu, 4 Sep 2025 10:29:54 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/15639 --- app/src/plugin/API.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/plugin/API.ts b/app/src/plugin/API.ts index c720c50f9..608166814 100644 --- a/app/src/plugin/API.ts +++ b/app/src/plugin/API.ts @@ -267,9 +267,12 @@ export const expandDocTree = async (options: { options.isSetCurrent = true; } if (isNotebook) { - liElement = file.element.querySelector(`.b3-list[data-url="${options.id}"]`).firstElementChild as HTMLElement; + liElement = file.element.querySelector(`.b3-list[data-url="${options.id}"]`)?.firstElementChild as HTMLElement; } else { const response = await fetchSyncPost("api/block/getBlockInfo", {id: options.id}); + if (response.code === -1) { + return; + } notebookId = response.data.box; liElement = await file.selectItem(response.data.box, response.data.path, undefined, undefined, options.isSetCurrent); }