Skip to content

Commit

Permalink
http: fix lint error in incoming message
Browse files Browse the repository at this point in the history
PR-URL: #33035
Refs: #30625
Reviewed-By: Robert Nagy <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
  • Loading branch information
dnlup authored and targos committed Dec 21, 2020
1 parent 397e31e commit 4b81d79
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/_http_incoming.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit 4b81d79

Please sign in to comment.