From 0d6fe56b8085d812b4efe310a27708d01d8f130f Mon Sep 17 00:00:00 2001 From: Yanzhen Yu Date: Wed, 1 Apr 2026 12:00:00 +0800 Subject: [PATCH] close #263 Since we improved the block class strategy, we need to check parent node before pushAdd. --- src/record/mutation.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/record/mutation.ts b/src/record/mutation.ts index c1e29134..0577858b 100644 --- a/src/record/mutation.ts +++ b/src/record/mutation.ts @@ -78,6 +78,9 @@ export default class MutationBuffer { */ const addQueue: Node[] = []; const pushAdd = (n: Node) => { + if (!n.parentNode) { + return; + } const parentId = mirror.getId((n.parentNode as Node) as INode); const nextId = n.nextSibling && mirror.getId((n.nextSibling as unknown) as INode);