From 70eaf55a9d2da25742df79a862edf16f122fdfbb 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 = {