Skip to content

Commit c186f01

Browse files
authored
Merge pull request #236 from sak0/fix_circuitbreaker_panic
fix circuitbreaker panic
2 parents 2ca5d86 + ff4f44a commit c186f01

File tree

1 file changed

+3
-3
lines changed
  • plugin/circuitbreaker/composite

1 file changed

+3
-3
lines changed

plugin/circuitbreaker/composite/rule.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,13 +163,13 @@ func (c *RuleContainer) realRefreshHealthCheck() {
163163
}
164164

165165
func selectCircuitBreakerRule(res model.Resource, object *model.ServiceRuleResponse, regexFunc func(string) *regexp.Regexp) *fault_tolerance.CircuitBreakerRule {
166-
if object == nil {
166+
if object == nil || object.Value == nil {
167167
return nil
168168
}
169-
if object.Value == nil {
169+
circuitBreaker, ok := object.Value.(*fault_tolerance.CircuitBreaker)
170+
if !ok || circuitBreaker == nil {
170171
return nil
171172
}
172-
circuitBreaker := object.Value.(*fault_tolerance.CircuitBreaker)
173173
rules := circuitBreaker.Rules
174174
if len(rules) == 0 {
175175
return nil

0 commit comments

Comments
 (0)