Treat empty xl.json as file not found (#6804)

If the buffer is empty we can avoid parsing
it and treat it essentially as `xl.json`
is effectively missing.
master
Harshavardhana 6 years ago committed by kannappanr
parent 2447bb58dd
commit c82acc599a
  1. 3
      cmd/xl-v1-utils.go

@ -311,6 +311,9 @@ func readXLMeta(ctx context.Context, disk StorageAPI, bucket string, object stri
}
return xlMetaV1{}, err
}
if len(xlMetaBuf) == 0 {
return xlMetaV1{}, errFileNotFound
}
// obtain xlMetaV1{} using `github.com/tidwall/gjson`.
xlMeta, err = xlMetaV1UnmarshalJSON(ctx, xlMetaBuf)
if err != nil {

Loading…
Cancel
Save