diff --git a/lib/internal/http2/core.js b/lib/internal/http2/core.js index 28acc533410d3f..ce659dfc3de131 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.