Always instantiate coredata CookieCategoryFilter to avoid nil pointer risks

Signed-off-by: Émile Ré <emile@probo.com>
This commit is contained in:
Émile Ré
2026-05-22 10:33:51 +02:00
parent 5abd670707
commit f8debf5406

View File

@@ -65,10 +65,11 @@ func (r *cookieBannerResolver) Categories(ctx context.Context, obj *types.Cookie
cursor := types.NewCursor(first, after, last, before, pageOrderBy)
scope := coredata.NewScopeFromObjectID(obj.ID)
var cdFilter *coredata.CookieCategoryFilter
if filter != nil && filter.ExcludeKind != nil {
cdFilter = coredata.NewCookieCategoryFilter(filter.ExcludeKind)
var excludeKind *coredata.CookieCategoryKind
if filter != nil {
excludeKind = filter.ExcludeKind
}
cdFilter := coredata.NewCookieCategoryFilter(excludeKind)
categories, err := r.cookieBanner.ListCategoriesForBanner(ctx, scope, obj.ID, cursor, cdFilter)
if err != nil {