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)