diff --git a/src/net/http/h2_bundle.go b/src/net/http/h2_bundle.go index 4be56f50c5..5f08857564 100644 --- a/src/net/http/h2_bundle.go +++ b/src/net/http/h2_bundle.go @@ -5038,7 +5038,7 @@ func (cc *http2ClientConn) streamByID(id uint32, andRemove bool) *http2clientStr cc.mu.Lock() defer cc.mu.Unlock() cs := cc.streams[id] - if andRemove && cs != nil { + if andRemove && cs != nil && !cc.closed { delete(cc.streams, id) close(cs.done) }