diff --git a/api/v1beta3/authpolicy_types.go b/api/v1beta3/authpolicy_types.go index 8aae9cda9..bbae0f157 100644 --- a/api/v1beta3/authpolicy_types.go +++ b/api/v1beta3/authpolicy_types.go @@ -166,12 +166,10 @@ func (p *AuthPolicy) Rules() map[string]kuadrantv1.MergeableRule { return rules } - { - rule := spec.AuthScheme.Response.Unauthenticated + if rule := spec.AuthScheme.Response.Unauthenticated; rule != nil { rules["response.unauthenticated#"] = kuadrantv1.NewMergeableRule(rule, policyLocator) } - { - rule := spec.AuthScheme.Response.Unauthorized + if rule := spec.AuthScheme.Response.Unauthorized; rule != nil { rules["response.unauthorized#"] = kuadrantv1.NewMergeableRule(rule, policyLocator) }