Skip to content

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

:adhesive_bandage:

Vanessae4b9feb4f6bf
diff --git a/app/src/layout/Wnd.ts b/app/src/layout/Wnd.ts
index 895951c747..d4528f9db4 100644
--- a/app/src/layout/Wnd.ts
+++ b/app/src/layout/Wnd.ts
@@ -363,18 +363,20 @@ export class Wnd {
}
}
});
- const initData = currentTab.headElement.getAttribute("data-initdata");
- if (initData) {
- const json = JSON.parse(initData);
- currentTab.addModel(new Editor({
- tab: currentTab,
- blockId: json.blockId,
- mode: json.mode,
- action: typeof json.action === "string" ? [json.action] : json.action,
- scrollAttr: json.scrollAttr,
- }));
- currentTab.headElement.removeAttribute("data-initdata");
- return;
+ if (currentTab) {
+ const initData = currentTab.headElement.getAttribute("data-initdata");
+ if (initData) {
+ const json = JSON.parse(initData);
+ currentTab.addModel(new Editor({
+ tab: currentTab,
+ blockId: json.blockId,
+ mode: json.mode,
+ action: typeof json.action === "string" ? [json.action] : json.action,
+ scrollAttr: json.scrollAttr,
+ }));
+ currentTab.headElement.removeAttribute("data-initdata");
+ return;
+ }
}
if (currentTab && target === currentTab.headElement) {