mirror of
https://github.com/rancher/norman.git
synced 2025-09-17 15:49:53 +00:00
fix nil pointer exceptions
This commit is contained in:
committed by
Darren Shepherd
parent
da40fa7b06
commit
1e15dbfbdc
@@ -216,6 +216,9 @@ func findCond(val reflect.Value, name string) *reflect.Value {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func getValue(obj interface{}, name ...string) reflect.Value {
|
func getValue(obj interface{}, name ...string) reflect.Value {
|
||||||
|
if obj == nil {
|
||||||
|
return reflect.Value{}
|
||||||
|
}
|
||||||
v := reflect.ValueOf(obj)
|
v := reflect.ValueOf(obj)
|
||||||
t := v.Type()
|
t := v.Type()
|
||||||
if t.Kind() == reflect.Ptr {
|
if t.Kind() == reflect.Ptr {
|
||||||
|
Reference in New Issue
Block a user