From cf5ee6c135688bad84516436dc9630ddd81f2ad5 Mon Sep 17 00:00:00 2001 From: fengmk2 Date: Wed, 27 Nov 2024 20:17:51 +0800 Subject: [PATCH] fix: ignore not exists queue request on client error closes https://github.com/nodejs/undici/issues/3857 --- lib/core/util.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/core/util.js b/lib/core/util.js index dfefac6d15c..8ec4ac0cfc4 100644 --- a/lib/core/util.js +++ b/lib/core/util.js @@ -824,6 +824,10 @@ function removeAllListeners (obj) { * @param {Error} err */ function errorRequest (client, request, err) { + if (!request) { + client.emit('error', err) + return + } try { request.onError(err) assert(request.aborted)