From ae5e55809b96da42b2653076257a52a962fba298 Mon Sep 17 00:00:00 2001 From: deveshmehta7 <41158641+deveshmehta7@users.noreply.github.com> Date: Sat, 3 Nov 2018 01:11:56 +0530 Subject: [PATCH] fix: Assertion error Fix - Fixed Assertion true === false error (#57) --- lib/spdy-transport/priority.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/spdy-transport/priority.js b/lib/spdy-transport/priority.js index 395cfa2..581a706 100644 --- a/lib/spdy-transport/priority.js +++ b/lib/spdy-transport/priority.js @@ -71,10 +71,9 @@ PriorityNode.prototype.remove = function remove () { PriorityNode.prototype.removeChild = function removeChild (child) { this.children.weight -= child.weight var index = utils.binarySearch(this.children.list, child, compareChildren) - assert(index !== -1) - - // Remove the child - this.children.list.splice(index, 1) + if (index !== -1 && this.children.list.length >= index) { + this.children.list.splice(index, 1) + } } PriorityNode.prototype.removeChildren = function removeChildren () {