mirror of
https://github.com/openai/openai-go.git
synced 2026-04-02 01:19:53 +09:00
fix(stream): ensure .Close() doesn't panic (#201)
This commit is contained in:
committed by
GitHub
parent
3e7551f958
commit
c574345a67
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user