diff options
author | isaacs <i@izs.me> | 2013-08-28 09:35:36 -0700 |
---|---|---|
committer | isaacs <i@izs.me> | 2013-08-28 09:35:39 -0700 |
commit | fbb963b5d520a70d9c3f2f9ec116d79a0c676f80 (patch) | |
tree | cd2325528af29c590fc9829562e0ed6b8ea75cf8 | |
parent | 02eb9c834a1ea6d97af17c556b6d63315da4aca5 (diff) | |
download | node-fbb963b5d520a70d9c3f2f9ec116d79a0c676f80.tar.gz |
stream: check _events before _events.error
This fixes the regression introduced by 5458079, which breaks the
net/net-pipe benchmark script.
Closes #6145
-rwxr-xr-x | lib/_stream_readable.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/_stream_readable.js b/lib/_stream_readable.js index 368c923b6..fd6396948 100755 --- a/lib/_stream_readable.js +++ b/lib/_stream_readable.js @@ -519,7 +519,7 @@ Readable.prototype.pipe = function(dest, pipeOpts) { } // This is a brutally ugly hack to make sure that our error handler // is attached before any userland ones. NEVER DO THIS. - if (!dest._events.error) + if (!dest._events || !dest._events.error) dest.on('error', onerror); else if (Array.isArray(dest._events.error)) dest._events.error.unshift(onerror); |