Skip to content

Commit

Permalink
fix nil kvps when dedup is false
Browse files Browse the repository at this point in the history
  • Loading branch information
hedzr committed Nov 17, 2024
1 parent 1d049d8 commit 9b58ba5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion slog/funcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ func argsToAttrs(kvps *Attrs, keysKnown map[string]bool, args ...any) { //nolint
func setUniqueKvp(keysKnown map[string]bool, kvps *Attrs, key string, val any) {
if _, ok := keysKnown[key]; ok {
for ix, v := range *kvps {
if v.Key() == key {
if v != nil && v.Key() == key {
(*kvps)[ix].SetValue(val)
}
}
Expand Down

0 comments on commit 9b58ba5

Please sign in to comment.