From 941bcd1deec3f029a38159d7f68e5b097265f378 Mon Sep 17 00:00:00 2001 From: Adrian-Stefan Mares Date: Tue, 29 Mar 2022 15:58:26 +0200 Subject: [PATCH] Fix nil check during pointer decoding --- mapstructure.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mapstructure.go b/mapstructure.go index 7581806a..9e13d758 100644 --- a/mapstructure.go +++ b/mapstructure.go @@ -1020,7 +1020,7 @@ func (d *Decoder) decodePtr(name string, data interface{}, val reflect.Value) (b // pointer to be nil as well. isNil := data == nil if !isNil { - switch v := reflect.Indirect(reflect.ValueOf(data)); v.Kind() { + switch v := reflect.ValueOf(data); v.Kind() { case reflect.Chan, reflect.Func, reflect.Interface,