Skip to content

Commit

Permalink
Merge pull request #169 from nkryuchkov/fix/intfwd-rule-panic
Browse files Browse the repository at this point in the history
Fix IntermediaryForwardRule panic
  • Loading branch information
志宇 authored Feb 28, 2020
2 parents 2427496 + 4bb182c commit 7724006
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/routing/rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -330,10 +330,10 @@ func (r Rule) Summary() *RuleSummary {
KeyRouteID: r.KeyRouteID(),
}

rd := r.RouteDescriptor()

switch t := summary.Type; t {
case RuleConsume:
rd := r.RouteDescriptor()

summary.ConsumeFields = &RuleConsumeFields{
RouteDescriptor: RouteDescriptorFields{
DstPK: rd.DstPK(),
Expand All @@ -343,6 +343,8 @@ func (r Rule) Summary() *RuleSummary {
},
}
case RuleForward:
rd := r.RouteDescriptor()

summary.ForwardFields = &RuleForwardFields{
RouteDescriptor: RouteDescriptorFields{
DstPK: rd.DstPK(),
Expand Down

0 comments on commit 7724006

Please sign in to comment.