diff --git a/lib/_stream_readable.js b/lib/_stream_readable.js index 92a1f6ad1ed52d..afa92f1d8cc907 100644 --- a/lib/_stream_readable.js +++ b/lib/_stream_readable.js @@ -664,7 +664,7 @@ Readable.prototype.unpipe = function(dest) { if (index === -1) return this; - state.pipes.splice(i, 1); + state.pipes.splice(index, 1); state.pipesCount -= 1; if (state.pipesCount === 1) state.pipes = state.pipes[0];