Skip to content

Commit

Permalink
handle nil pointers
Browse files Browse the repository at this point in the history
  • Loading branch information
m1heng committed Oct 12, 2024
1 parent c3c8538 commit 224e5c4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions bridges/otellogrus/hook.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,9 @@ func convertValue(v interface{}) log.Value {
}
return log.MapValue(kvs...)
case reflect.Ptr, reflect.Interface:
if val.IsNil() {
return log.Value{}
}
return convertValue(val.Elem().Interface())
}

Expand Down

0 comments on commit 224e5c4

Please sign in to comment.