Skip to content

Commit

Permalink
fix yaml decoding bug unassigns value
Browse files Browse the repository at this point in the history
  • Loading branch information
mafredri committed Nov 13, 2024
1 parent 5276b64 commit e053fda
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions yaml.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,10 @@ func (o *Option) setFromYAMLNode(n *yaml.Node) error {
// We treat empty values as nil for consistency with other option
// mechanisms.
if len(n.Content) == 0 {
o.Value = nil
return nil
if o.Value == nil {
return nil
}
return o.Value.Set("")
}
return n.Decode(o.Value)
case yaml.MappingNode:
Expand Down

0 comments on commit e053fda

Please # to comment.