quic: fixes undefined handle in QuicStream kInspect

If the #handle is undefined and not QuicStream,
 while kInspect is called
 `DataViewPrototypeGetByteLength` will throw.

Signed-off-by: Marten Richter <marten.richter@freenet.de>
PR-URL: https://github.com/nodejs/node/pull/64170
Backport-PR-URL: https://github.com/nodejs/node/pull/64675
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Reviewed-By: Tim Perry <pimterry@gmail.com>
This commit is contained in:
Marten Richter authored and Antoine du Hamel committed 2026-08-06 11:33:43 +02:00
1 parent 3dd04b3ec6
commit bd477a3202
1 file changed
+2 -1
+2 -1
View File
@@ -933,7 +933,8 @@ class QuicStreamState {
}
[kInspect](depth, options) {
if (DataViewPrototypeGetByteLength(this.#handle) === 0) {
if (this.#handle === undefined ||
DataViewPrototypeGetByteLength(this.#handle) === 0) {
return 'QuicStreamState { <Closed> }';
}