Skip to content

Commit

Permalink
style: 增加健壮性
Browse files Browse the repository at this point in the history
  • Loading branch information
WTIFS committed Dec 19, 2023
1 parent 273ae14 commit 7131808
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions plugin/circuitbreaker/composite/counter.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,10 @@ func (rc *ResourceCounters) CurrentCircuitBreakerStatus() model.CircuitBreakerSt
if val == nil {
return nil
}
wrapper := val.(*model.CircuitBreakerStatusWrapper)
return wrapper.Val
if wrapper, ok := val.(*model.CircuitBreakerStatusWrapper); ok {
return wrapper.Val
}
return nil
}

func (rc *ResourceCounters) CloseToOpen(breaker string) {
Expand Down

0 comments on commit 7131808

Please sign in to comment.