From f52b02f4b180bd7adcc683d3d02ccc111c518536 Mon Sep 17 00:00:00 2001 From: Yanzhen Yu Date: Sun, 6 Sep 2020 18:24:27 +0800 Subject: [PATCH] close #319 handle undefined nextId Looks like some serializer will omit field with null value, so we do some checks in the replayer to avoid of dead loop. --- src/replay/index.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/replay/index.ts b/src/replay/index.ts index 1d45e53c..449a3189 100644 --- a/src/replay/index.ts +++ b/src/replay/index.ts @@ -817,7 +817,12 @@ export class Replayer { next = mirror.getNode(mutation.nextId) as Node; } // next not present at this moment - if (mutation.nextId !== null && mutation.nextId !== -1 && !next) { + if ( + mutation.nextId !== null && + mutation.nextId !== undefined && + mutation.nextId !== -1 && + !next + ) { return queue.push(mutation); }