diff --git a/internal/provider/kubernetes/predicates.go b/internal/provider/kubernetes/predicates.go index 406948e11c44..d669dc7f5569 100644 --- a/internal/provider/kubernetes/predicates.go +++ b/internal/provider/kubernetes/predicates.go @@ -319,9 +319,12 @@ func (r *gatewayAPIReconciler) validateDeploymentForReconcile(obj client.Object) if !ok { return false } - for _, gtw := range res.Gateways { - gtw := gtw - r.statusUpdateForGateway(ctx, gtw) + if res != nil && len(res.Gateways) > 0 { + for _, gw := range res.Gateways { + gw := gw + r.statusUpdateForGateway(ctx, gw) + } + } } return false }