From bd477a32026f97d0d7d0d950146eaa3260daa379 Mon Sep 17 00:00:00 2001 From: Marten Richter Date: Thu, 2 Jul 2026 16:39:30 +0200 Subject: [PATCH] quic: fixes undefined handle in QuicStream kInspect MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the #handle is undefined and not QuicStream, while kInspect is called `DataViewPrototypeGetByteLength` will throw. Signed-off-by: Marten Richter PR-URL: https://github.com/nodejs/node/pull/64170 Backport-PR-URL: https://github.com/nodejs/node/pull/64675 Reviewed-By: James M Snell Reviewed-By: Gürgün Dayıoğlu Reviewed-By: Tim Perry --- lib/internal/quic/state.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/internal/quic/state.js b/lib/internal/quic/state.js index 22763c1df31..8815b0bb4c3 100644 --- a/lib/internal/quic/state.js +++ b/lib/internal/quic/state.js @@ -933,7 +933,8 @@ class QuicStreamState { } [kInspect](depth, options) { - if (DataViewPrototypeGetByteLength(this.#handle) === 0) { + if (this.#handle === undefined || + DataViewPrototypeGetByteLength(this.#handle) === 0) { return 'QuicStreamState { }'; }