diff --git a/lib/internal/http2/core.js b/lib/internal/http2/core.js index 487bbe4f3b8a0f..a772fb277d7767 100644 --- a/lib/internal/http2/core.js +++ b/lib/internal/http2/core.js @@ -330,7 +330,7 @@ function tryClose(fd) { function onStreamTrailers() { const stream = this[kOwner]; stream[kState].trailersReady = true; - if (stream.destroyed) + if (stream.destroyed || stream.closed) return; if (!stream.emit('wantTrailers')) { // There are no listeners, send empty trailing HEADERS frame and close.