Skip to content

Commit e053fda

Browse files
committed
fix yaml decoding bug unassigns value
1 parent 5276b64 commit e053fda

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

yaml.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,10 @@ func (o *Option) setFromYAMLNode(n *yaml.Node) error {
213213
// We treat empty values as nil for consistency with other option
214214
// mechanisms.
215215
if len(n.Content) == 0 {
216-
o.Value = nil
217-
return nil
216+
if o.Value == nil {
217+
return nil
218+
}
219+
return o.Value.Set("")
218220
}
219221
return n.Decode(o.Value)
220222
case yaml.MappingNode:

0 commit comments

Comments
 (0)