From a1125ae374cbb64365a67e92228657e781954e63 Mon Sep 17 00:00:00 2001 From: John Pham Date: Wed, 30 Jun 2021 10:40:58 -0700 Subject: [PATCH] Pull in fix for #528 from rrweb --- package.json | 2 +- src/record/mutation.ts | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) 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;