Skip to content

Commit c032a74

Browse files
committed
quic: fix crash in onStreamClose
1 parent a7db300 commit c032a74

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎lib/internal/quic/quic.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1009,9 +1009,10 @@ setCallbacks({
10091009
// Called when the stream C++ handle has been closed. The error is
10101010
// either undefined (clean close) or a raw array [type, code, reason]
10111011
// from QuicError::ToV8Value. Convert to a proper Node.js Error.
1012+
if (!this[kOwner]) return;
10121013
if (error !== undefined) {
10131014
error = convertQuicError(error);
1014-
} else if (this[kOwner] && !this[kOwner].destroyed) {
1015+
} else if (!this[kOwner].destroyed) {
10151016
// The stream is closing cleanly, but it may have been reset by the
10161017
// peer (ReceiveStreamReset) or locally (resetStream). The C++ side
10171018
// records the reset code in state.resetCode. If set, surface the

0 commit comments

Comments
 (0)