Skip to content

Commit

Permalink
Prevent panic when loading nil values from config
Browse files Browse the repository at this point in the history
  • Loading branch information
ItalyPaleAle committed Jan 13, 2024
1 parent 7b9831c commit 8868a68
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/utils/configloader/configloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func Load(dst any, opts LoadOptions) error {
// Ignore fields with zero value
if opts.IgnoreZeroValuesInConfig {
maps.DeleteFunc(m, func(s string, a any) bool {
return reflect.ValueOf(a).IsZero()
return a == nil || reflect.ValueOf(a).IsZero()
})
}

Expand Down

0 comments on commit 8868a68

Please sign in to comment.