Fix: config parse panic
This commit is contained in:
parent
082847b403
commit
230e01f078
1 changed files with 5 additions and 0 deletions
|
@ -216,6 +216,11 @@ func (d *Decoder) decodeMapFromMap(name string, dataVal reflect.Value, val refle
|
|||
}
|
||||
|
||||
v := dataVal.MapIndex(k).Interface()
|
||||
if v == nil {
|
||||
errors = append(errors, fmt.Sprintf("filed %s invalid", fieldName))
|
||||
continue
|
||||
}
|
||||
|
||||
currentVal := reflect.Indirect(reflect.New(valElemType))
|
||||
if err := d.decode(fieldName, v, currentVal); err != nil {
|
||||
errors = append(errors, err.Error())
|
||||
|
|
Loading…
Reference in a new issue