Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: https://github.com/siyuan-note/siyuan/issues/16708

Vanessaff5cf4c68509
diff --git a/app/src/protyle/breadcrumb/index.ts b/app/src/protyle/breadcrumb/index.ts
index 70e09aa80c..b6d3f5e238 100644
--- a/app/src/protyle/breadcrumb/index.ts
+++ b/app/src/protyle/breadcrumb/index.ts
@@ -213,6 +213,9 @@ ${padHTML}
if (!blockElement) {
blockElement = getNoContainerElement(protyle.wysiwyg.element.firstElementChild) || protyle.wysiwyg.element.firstElementChild;
}
+ if (!blockElement) {
+ return;
+ }
const id = blockElement.getAttribute("data-node-id");
fetchPost("/api/block/getBlockBreadcrumb", {id, excludeTypes: []}, (response) => {
response.data.forEach((item: IBreadcrumb) => {
@@ -603,6 +606,10 @@ ${padHTML}
if (!blockElement) {
blockElement = getNoContainerElement(protyle.wysiwyg.element.firstElementChild) || protyle.wysiwyg.element.firstElementChild;
}
+ if (!blockElement) {
+ // 浮窗删除单个块后,面包屑无法获取到 blockElement,直接返回即可
+ return;
+ }
const id = blockElement.getAttribute("data-node-id");
if (id === this.id && !update) {
protyle.breadcrumb.element.querySelectorAll(".protyle-breadcrumb__item--active").forEach(item => {