Skip to content

Commit

Permalink
Fix nil check during pointer decoding
Browse files Browse the repository at this point in the history
  • Loading branch information
adriansmares committed Apr 13, 2023
1 parent afe03c0 commit 941bcd1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mapstructure.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 941bcd1

Please sign in to comment.