Skip to content

Commit

Permalink
Merge pull request #58 from wenj91/dev
Browse files Browse the repository at this point in the history
f-fix base type reflect panic
  • Loading branch information
wenj91 authored Feb 6, 2021
2 parents 0708b4c + 8e48f83 commit 49dafa0
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions proc_params.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,14 @@ func structToMap(s interface{}) map[string]interface{} {

func fieldToVal(field interface{}) (interface{}, bool) {
objVal := reflect.ValueOf(field)
if objVal.IsNil() {
return nil, false

k := objVal.Kind()
switch k {
case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer,
reflect.Interface, reflect.Slice:
if objVal.IsNil() {
return nil, false
}
}

if objVal.Kind() == reflect.Ptr {
Expand Down

0 comments on commit 49dafa0

Please sign in to comment.