fix(stream): ensure .Close() doesn't panic (#201)

This commit is contained in:
stainless-app[bot]
2025-02-03 15:32:55 +00:00
committed by GitHub
parent 3e7551f958
commit c574345a67

View File

@@ -171,5 +171,9 @@ func (s *Stream[T]) Err() error {
}
func (s *Stream[T]) Close() error {
if s.decoder == nil {
// already closed
return nil
}
return s.decoder.Close()
}