close channel upon error in Walk()'er (#9042)

This commit is contained in:
Harshavardhana
2020-02-26 09:28:58 +05:30
committed by GitHub
parent deb3911f5e
commit 6f66f1a910
3 changed files with 6 additions and 0 deletions
+2
View File
@@ -1617,6 +1617,8 @@ func (s *xlSets) ListBucketsHeal(ctx context.Context) ([]BucketInfo, error) {
// then Walk() stops the walker.
func (s *xlSets) Walk(ctx context.Context, bucket, prefix string, results chan<- ObjectInfo) error {
if err := checkListObjsArgs(ctx, bucket, prefix, "", s); err != nil {
// Upon error close the channel.
close(results)
return err
}