mirror of
https://github.com/nodejs/node.git
synced 2026-11-21 12:59:16 -05:00
quic: fix crash in onStreamClose
onStreamClose could crash, if this[kOwner] was not set. Signed-off-by: Marten Richter <marten.richter@freenet.de> PR-URL: https://github.com/nodejs/node/pull/65861 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Xuguang Mei <meixuguang@gmail.com>
This commit is contained in:
1 parent
e4186d6942
commit
ee354929da
1 file changed
+2
-1
@@ -962,9 +962,10 @@ setCallbacks({
|
||||
// Called when the stream C++ handle has been closed. The error is
|
||||
// either undefined (clean close) or a raw array [type, code, reason]
|
||||
// from QuicError::ToV8Value. Convert to a proper Node.js Error.
|
||||
if (!this[kOwner]) return;
|
||||
if (error !== undefined) {
|
||||
error = convertQuicError(error);
|
||||
} else if (this[kOwner] && !this[kOwner].destroyed) {
|
||||
} else if (!this[kOwner].destroyed) {
|
||||
// The stream is closing cleanly, but it may have been reset by the
|
||||
// peer (ReceiveStreamReset) or locally (resetStream). The C++ side
|
||||
// records the reset code in state.resetCode. If set, surface the
|
||||
|
||||
Reference in new issue
Block a user