Skip to content

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

:bug: https://github.com/siyuan-note/siyuan/issues/14620

Vanessa2c8d552d723d
diff --git a/app/src/protyle/toolbar/index.ts b/app/src/protyle/toolbar/index.ts
index c6c431d12b..7c357e83f2 100644
--- a/app/src/protyle/toolbar/index.ts
+++ b/app/src/protyle/toolbar/index.ts
@@ -633,7 +633,7 @@ export class Toolbar {
previousIsSame = index === 0 && previousElement && previousElement.nodeType !== 3 &&
isArrayEqual(types, (previousElement.getAttribute("data-type") || "").split(" ")) &&
hasSameTextStyle(item, previousElement, textObj);
- if (index === 0 && !previousIsSame && previousElement.nodeType === 3 && previousElement.textContent === Constants.ZWSP) {
+ if (index === 0 && !previousIsSame && previousElement && previousElement.nodeType === 3 && previousElement.textContent === Constants.ZWSP) {
const tempPreviousElement = previousElement.previousSibling as HTMLElement;
previousIsSame = tempPreviousElement && tempPreviousElement.nodeType !== 3 &&
isArrayEqual(types, (tempPreviousElement.getAttribute("data-type") || "").split(" ")) &&