return appropriate errors upon parseErrors (#13831)

This commit is contained in:
Harshavardhana
2021-12-05 11:36:26 -08:00
committed by GitHub
parent f6190d6751
commit 8591d17d82
2 changed files with 5 additions and 3 deletions

View File

@@ -535,7 +535,7 @@ func (l *ObjectLegalHold) IsEmpty() bool {
func ParseObjectLegalHold(reader io.Reader) (hold *ObjectLegalHold, err error) {
hold = &ObjectLegalHold{}
if err = xml.NewDecoder(reader).Decode(hold); err != nil {
return
return nil, err
}
if !hold.Status.Valid() {