Skip to content

Commit

Permalink
nil pointer fixes (istio#4736)
Browse files Browse the repository at this point in the history
Signed-off-by: Shriram Rajagopalan <shriramr@vmware.com>
  • Loading branch information
rshriram authored Apr 4, 2018
1 parent e51254e commit 57cff09
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pilot/pkg/networking/core/v1alpha3/listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,8 @@ func (configgen *ConfigGeneratorImpl) buildSidecarListeners(env model.Environmen
// configuration for co-located service proxyInstances.
func (configgen *ConfigGeneratorImpl) buildSidecarInboundListeners(env model.Environment, node model.Proxy,
proxyInstances []*model.ServiceInstance) []*xdsapi.Listener {
listeners := make([]*xdsapi.Listener, 0, len(proxyInstances))

var listeners []*xdsapi.Listener
mesh := env.Mesh
config := env.IstioConfigStore
// inbound connections/requests are redirected to the endpoint address but appear to be sent
Expand Down
2 changes: 1 addition & 1 deletion pilot/pkg/networking/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func BuildAddress(ip string, port uint32) core.Address {
// TODO(mostrowski): consider passing map around to save iteration.
func GetByAddress(listeners []*xdsapi.Listener, addr string) *xdsapi.Listener {
for _, listener := range listeners {
if listener.Address.String() == addr {
if listener != nil && listener.Address.String() == addr {
return listener
}
}
Expand Down

0 comments on commit 57cff09

Please sign in to comment.