From f052192b39ff2f330d62bfa407da3f71ce651c4d Mon Sep 17 00:00:00 2001 From: mariusor Date: Fri, 4 Nov 2022 19:01:11 +0100 Subject: [PATCH] Fix IsNil for unrecognized types --- item.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/item.go b/item.go index 7d8405a..567bcb4 100644 --- a/item.go +++ b/item.go @@ -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 }