diff --git a/agent/proxycfg/mesh_gateway.go b/agent/proxycfg/mesh_gateway.go index 906ab25961ff..3d8bcd43a9aa 100644 --- a/agent/proxycfg/mesh_gateway.go +++ b/agent/proxycfg/mesh_gateway.go @@ -673,9 +673,10 @@ func (s *handlerMeshGateway) handleUpdate(ctx context.Context, u UpdateEvent, sn return fmt.Errorf("invalid type for config entry: %T", resp.Entry) } - limits := serviceDefaults.UpstreamConfig.Defaults.Limits - if limits != nil { - snap.MeshGateway.Limits = limits + if serviceDefaults.UpstreamConfig != nil && serviceDefaults.UpstreamConfig.Defaults != nil { + if serviceDefaults.UpstreamConfig.Defaults.Limits != nil { + snap.MeshGateway.Limits = serviceDefaults.UpstreamConfig.Defaults.Limits + } } default: