Skip to content

Commit

Permalink
fix: nil pointer dereference on item (#1290)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lin-1997 authored Nov 22, 2023
1 parent 5f207e2 commit 4d4a20a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugin/statis/base/cachecall.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ func (c *CacheStatics) Add(ac metrics.CallMetric) {
index := fmt.Sprintf("%v", ac.Protocol)
item, exist := c.statis[index]
if !exist {
c.statis[index] = &CacheCallStatisItem{
item = &CacheCallStatisItem{
cacheType: ac.Protocol,
}
c.statis[index] = item
}

item = c.statis[index]
if ac.Success {
item.hitCount += int64(ac.Times)
} else {
Expand Down

0 comments on commit 4d4a20a

Please sign in to comment.