diff --git a/app/src/protyle/wysiwyg/transaction.ts b/app/src/protyle/wysiwyg/transaction.ts index f045f89cd..909bc35c9 100644 --- a/app/src/protyle/wysiwyg/transaction.ts +++ b/app/src/protyle/wysiwyg/transaction.ts @@ -692,7 +692,7 @@ export const onTransaction = (protyle: IProtyle, operation: IOperation, isUndo: if (getContenteditableElement(rangeBlockElement)) { range.insertNode(document.createElement("wbr")); } else { - getContenteditableElement(updateElements[0]).insertAdjacentHTML("afterbegin", ""); + getContenteditableElement(updateElements[0])?.insertAdjacentHTML("afterbegin", ""); } } }