From 4b81d79b58650df5bdd42a9ba4e2e0ec81aca9a3 Mon Sep 17 00:00:00 2001 From: Daniele Belardi Date: Wed, 9 Dec 2020 08:05:00 +0100 Subject: [PATCH] http: fix lint error in incoming message PR-URL: https://github.com/nodejs/node/pull/33035 Refs: https://github.com/nodejs/node/issues/30625 Reviewed-By: Robert Nagy Reviewed-By: Matteo Collina Reviewed-By: Rich Trott --- lib/_http_incoming.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 = {