diff --git a/package.json b/package.json index 1a7456c6..5428c085 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@highlight-run/rrweb", - "version": "0.12.0", + "version": "0.12.1", "description": "record and replay the web", "scripts": { "test": "npm run bundle:browser && cross-env TS_NODE_CACHE=false TS_NODE_FILES=true mocha -r ts-node/register test/**/*.test.ts", diff --git a/src/record/mutation.ts b/src/record/mutation.ts index a58e266e..ef4c5e47 100644 --- a/src/record/mutation.ts +++ b/src/record/mutation.ts @@ -60,7 +60,11 @@ class DoubleLinkedList { if (current) { current.previous = node; } - } else if (n.nextSibling && isNodeInLinkedList(n.nextSibling)) { + } else if ( + n.nextSibling && + isNodeInLinkedList(n.nextSibling) && + n.nextSibling.__ln.previous + ) { const current = n.nextSibling.__ln.previous; node.previous = current; node.next = n.nextSibling.__ln;