Skip to content

Commit

Permalink
[bug] fix interface nil convert panic (easegress-io#164)
Browse files Browse the repository at this point in the history
* [bug] fix interface nil convert panic

* [bug] fix GetHTTPServer nil interface convert panic
  • Loading branch information
benja-wu authored Aug 10, 2021
1 parent cbb3d8a commit eb2250a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/object/trafficcontroller/trafficcontroller.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,9 @@ func (tc *TrafficController) GetHTTPServer(namespace, name string) (*supervisor.
}

entity, exists := space.httpservers.Load(name)
if !exists {
return nil, false
}

return entity.(*supervisor.ObjectEntity), exists
}
Expand Down Expand Up @@ -546,6 +549,9 @@ func (tc *TrafficController) GetHTTPPipeline(namespace, name string) (*superviso
}

entity, exists := space.httppipelines.Load(name)
if !exists {
return nil, false
}

return entity.(*supervisor.ObjectEntity), exists
}
Expand Down

0 comments on commit eb2250a

Please sign in to comment.