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.
This commit is contained in:
Harshavardhana 2018-11-13 11:57:03 -08:00 committed by kannappanr
parent 2447bb58dd
commit c82acc599a

View File

@ -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 {