diff --git a/lib/_stream_readable.js b/lib/_stream_readable.js index bebbc80e2bf8dc..804b46e1f47d8d 100644 --- a/lib/_stream_readable.js +++ b/lib/_stream_readable.js @@ -211,7 +211,7 @@ function howMuchToRead(n, state) { if (state.objectMode) return n === 0 ? 0 : 1; - if (n === null || isNaN(n)) { + if (n === null || n !== n) { // only flow one buffer at a time if (state.flowing && state.buffer.length) return state.buffer[0].length;