From 0ae142a1c9634d06e32fd550bb4651db44870aa0 Mon Sep 17 00:00:00 2001 From: Ciro Spaciari Date: Fri, 11 Oct 2024 14:36:58 -0700 Subject: [PATCH] check closed --- src/js/node/http2.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/node/http2.ts b/src/js/node/http2.ts index ee1d99279da8d..28cc290eee6af 100644 --- a/src/js/node/http2.ts +++ b/src/js/node/http2.ts @@ -1745,7 +1745,7 @@ class Http2Stream extends Duplex { sendTrailers(headers) { const session = this[bunHTTP2Session]; - if (this.destroyed) { + if (this.destroyed || this.closed) { const error = new Error(`ERR_HTTP2_INVALID_STREAM: The stream has been destroyed`); error.code = "ERR_HTTP2_INVALID_STREAM"; throw error;