diff --git a/lib/_http_incoming.js b/lib/_http_incoming.js index d0c7ce9ba2de06..1b6099a89dc65c 100644 --- a/lib/_http_incoming.js +++ b/lib/_http_incoming.js @@ -359,7 +359,11 @@ IncomingMessage.prototype._dump = function _dump() { }; function onError(instance, cb, error) { - instance.listenerCount('error') > 0 ? cb(error) : cb(); + if (instance.listenerCount('error') > 0) { + cb(error); + } else { + cb(); + } } module.exports = {