mirror of
https://github.com/minio/minio.git
synced 2025-11-08 21:24:55 -05:00
avoid close 'nil' panics if any (#18890)
brings a generic implementation that prints a stack trace for 'nil' channel closes(), if not safely closes it.
This commit is contained in:
@@ -23,6 +23,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/minio/madmin-go/v3"
|
||||
xioutil "github.com/minio/minio/internal/ioutil"
|
||||
)
|
||||
|
||||
// StorageAPI interface.
|
||||
@@ -280,7 +281,7 @@ func (p *unrecognizedDisk) StatInfoFile(ctx context.Context, volume, path string
|
||||
}
|
||||
|
||||
func (p *unrecognizedDisk) ReadMultiple(ctx context.Context, req ReadMultipleReq, resp chan<- ReadMultipleResp) error {
|
||||
close(resp)
|
||||
xioutil.SafeClose(resp)
|
||||
return errDiskNotFound
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user