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);