Skip to content

Commit

Permalink
fix(config): check value
Browse files Browse the repository at this point in the history
  • Loading branch information
fiftin committed Sep 14, 2023
1 parent d726ba4 commit f553def
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions util/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,10 @@ func loadDefaultsToObject(obj interface{}) error {
v = reflect.Indirect(v)
}

if v.Type().Kind() != reflect.Struct {
return nil
}

for i := 0; i < t.NumField(); i++ {
fieldType := t.Field(i)
fieldValue := v.Field(i)
Expand Down

0 comments on commit f553def

Please sign in to comment.