Fix IsNil for unrecognized types

This commit is contained in:
mariusor 2022-11-04 19:01:11 +01:00
parent 066cec4fee
commit f052192b39
No known key found for this signature in database
GPG key ID: 35D8720425890EF7

View file

@ -146,7 +146,7 @@ func IsNil(it Item) bool {
// NOTE(marius): we're not dealing with a type that we know about, so we use slow reflection
// as we still care about the result
v := reflect.ValueOf(it)
isNil = v.Kind() != reflect.Pointer || v.IsNil()
isNil = v.Kind() == reflect.Pointer && v.IsNil()
}
return isNil
}