Skip to content

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

:bug:

Vanessa1b02bf91d530
diff --git a/app/src/block/popover.ts b/app/src/block/popover.ts
index df6a745c6d..6a10e4d220 100644
--- a/app/src/block/popover.ts
+++ b/app/src/block/popover.ts
@@ -138,7 +138,7 @@ export const initBlockPopover = () => {
ids = [dataId];
}
defIds = JSON.parse(popoverTargetElement.getAttribute("data-defids") || "[]");
- } else if (popoverTargetElement.getAttribute("data-type").indexOf("virtual-block-ref") > -1) {
+ } else if (popoverTargetElement.getAttribute("data-type")?.indexOf("virtual-block-ref") > -1) {
const nodeElement = hasClosestBlock(popoverTargetElement);
if (nodeElement) {
const postResponse = await fetchSyncPost("/api/block/getBlockDefIDsByRefText", {
@@ -147,7 +147,7 @@ export const initBlockPopover = () => {
});
ids = postResponse.data;
}
- } else if (popoverTargetElement.getAttribute("data-type").split(" ").includes("a")) {
+ } else if (popoverTargetElement.getAttribute("data-type")?.split(" ").includes("a")) {
// 以思源协议开头的链接
ids = [popoverTargetElement.getAttribute("data-href").substr(16, 22)];
} else {