Skip to content

Commit

Permalink
histograms: fixed panic in merge when target bucket is nil
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewChubatiuk committed May 20, 2024
1 parent a52bdc6 commit 5e5f209
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions histogram.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@ func (h *Histogram) Merge(b *Histogram) {
if db == nil {
continue
}
if h.decimalBuckets[i] == nil {
var b [bucketsPerDecimal]uint64
h.decimalBuckets[i] = &b
}
for j := range db {
h.decimalBuckets[i][j] = db[j]
}
Expand Down

0 comments on commit 5e5f209

Please sign in to comment.