Skip to content

Commit

Permalink
close #491 check whether link node is head
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuyz0112 committed Feb 27, 2021
1 parent 860ff38 commit 2c6be72
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/record/mutation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,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;
Expand Down

0 comments on commit 2c6be72

Please sign in to comment.