From 15a1e57dda76377e5eb69057982173731a60c859 Mon Sep 17 00:00:00 2001 From: Geoffrey Booth Date: Tue, 3 Jun 2025 21:55:51 -0700 Subject: [PATCH] fix: add guard (#4248) --- lib/api/api-stream.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/api/api-stream.js b/lib/api/api-stream.js index eb927336a3f..5d0b3fbe633 100644 --- a/lib/api/api-stream.js +++ b/lib/api/api-stream.js @@ -117,7 +117,7 @@ class StreamHandler extends AsyncResource { const { callback, res, opaque, trailers, abort } = this this.res = null - if (err || !res.readable) { + if (err || !res?.readable) { util.destroy(res, err) }