From 94bb3c9301d8a6c62d44d0fddd9996387c906396 Mon Sep 17 00:00:00 2001 From: PYZ <592744797@qq.com> Date: Fri, 20 Apr 2018 11:19:08 +0800 Subject: [PATCH] fix bug --- lib/linked-array.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/linked-array.js b/lib/linked-array.js index 98c2cf8..38d8a31 100644 --- a/lib/linked-array.js +++ b/lib/linked-array.js @@ -39,6 +39,10 @@ export default class LinkedArray { } remove(node) { + if(!node._prev && !node._next) { + return ; + } + if (node._prev) { node._prev._next = node._next; } else {