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/5607

Vanessac358f8f8ee76
diff --git a/app/src/protyle/undo/index.ts b/app/src/protyle/undo/index.ts
index 46591d70a4..3a7f10e366 100644
--- a/app/src/protyle/undo/index.ts
+++ b/app/src/protyle/undo/index.ts
@@ -64,7 +64,9 @@ class Undo {
}
public replace(doOperations: IOperation[]) {
- this.undoStack[this.undoStack.length - 1].doOperations = doOperations;
+ if (this.undoStack.length > 0) {
+ this.undoStack[this.undoStack.length - 1].doOperations = doOperations;
+ }
}
public add( doOperations: IOperation[], undoOperations: IOperation[]) {