Add nil-receiver awareness to all Reader/Writer
This commit is contained in:
parent
dbc41bb805
commit
98dc811536
5 changed files with 20 additions and 3 deletions
|
@ -115,6 +115,10 @@ func (l *blobReader) Read(p []byte) (int, error) {
|
|||
}
|
||||
|
||||
func (l *blobReader) Close() error {
|
||||
if l == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
if !l.closed {
|
||||
err := l.f.Close()
|
||||
l.closed = true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue