Fix a panic introduced by #1598
- Fixes: #1618 Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This commit is contained in:
@@ -125,6 +125,10 @@ func getNestedFieldValue(obj interface{}, name string) (value reflect.Value, err
|
||||
}
|
||||
value = value.Elem()
|
||||
}
|
||||
if !value.IsValid() {
|
||||
err = fmt.Errorf("no value: %v", name)
|
||||
return
|
||||
}
|
||||
value = value.FieldByName(fieldName)
|
||||
if key != "" {
|
||||
value = value.MapIndex(reflect.ValueOf(key))
|
||||
|
||||
Reference in New Issue
Block a user