diff --git a/internal/bucket/lifecycle/filter.go b/internal/bucket/lifecycle/filter.go index 446397a50..6e605d3e3 100644 --- a/internal/bucket/lifecycle/filter.go +++ b/internal/bucket/lifecycle/filter.go @@ -49,6 +49,10 @@ type Filter struct { // MarshalXML - produces the xml representation of the Filter struct // only one of Prefix, And and Tag should be present in the output. func (f Filter) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if !f.set { + return nil + } + if err := e.EncodeToken(start); err != nil { return err }