diff --git a/lib/_stream_readable.js b/lib/_stream_readable.js index 9438bf92d3..0844604d96 100644 --- a/lib/_stream_readable.js +++ b/lib/_stream_readable.js @@ -671,7 +671,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];