file parser: skip nil value.
This commit is contained in:
parent
1dc6f39b55
commit
44a244b1cb
2 changed files with 18 additions and 0 deletions
|
@ -28,6 +28,10 @@ func decodeRaw(node *parser.Node, vData reflect.Value, filters ...string) error
|
|||
sortedKeys := sortKeys(vData, filters)
|
||||
|
||||
for _, key := range sortedKeys {
|
||||
if vData.MapIndex(key).IsNil() {
|
||||
continue
|
||||
}
|
||||
|
||||
value := reflect.ValueOf(vData.MapIndex(key).Interface())
|
||||
|
||||
child := &parser.Node{Name: key.String()}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue