mirror of
https://github.com/pgsty/minio.git
synced 2026-07-22 13:40:22 +03: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:
@@ -760,7 +760,7 @@ func (er erasureObjects) getObjectFileInfo(ctx context.Context, bucket, object s
|
||||
}
|
||||
|
||||
mrfCheck := make(chan FileInfo)
|
||||
defer close(mrfCheck)
|
||||
defer xioutil.SafeClose(mrfCheck)
|
||||
|
||||
var rw sync.Mutex
|
||||
|
||||
@@ -810,7 +810,7 @@ func (er erasureObjects) getObjectFileInfo(ctx context.Context, bucket, object s
|
||||
}
|
||||
|
||||
wg.Wait()
|
||||
close(done)
|
||||
xioutil.SafeClose(done)
|
||||
|
||||
fi, ok := <-mrfCheck
|
||||
if !ok {
|
||||
|
||||
Reference in New Issue
Block a user