From 65262a2b784893acaff7889dbe29b21d5f34d070 Mon Sep 17 00:00:00 2001 From: Sarah Alsmiller Date: Mon, 15 Apr 2024 11:42:46 -0500 Subject: [PATCH] nil check --- agent/proxycfg/mesh_gateway.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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: