From a4436f569d3c63f9399ce1e5f180c80b200ca3a9 Mon Sep 17 00:00:00 2001 From: KrzysztofPajak Date: Fri, 28 Aug 2026 15:26:16 +0200 Subject: [PATCH] fix(web): remove spurious null-guard on Category.PageSizeOptions GetViewSortSizeOptionsHandler.PrepareSortingOptions() threw ArgumentNullException whenever the entity's PageSizeOptions field was left empty in admin (Category/Brand/Collection/Vendor/ProductTag all share this handler), crashing the storefront page before rendering. The guard was misplaced: PrepareSortingOptions never reads PageSizeOptions at all. The actual consumer, PreparePageSizeOptions, already null-checks it correctly and falls back to the default page size when null or empty. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01QArzgnTu2jhTmm4LiMjuNF --- .../Features/Handlers/Catalog/GetViewSortSizeOptionsHandler.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Web/Grand.Web/Features/Handlers/Catalog/GetViewSortSizeOptionsHandler.cs b/src/Web/Grand.Web/Features/Handlers/Catalog/GetViewSortSizeOptionsHandler.cs index 84e285c85..03fdb42db 100644 --- a/src/Web/Grand.Web/Features/Handlers/Catalog/GetViewSortSizeOptionsHandler.cs +++ b/src/Web/Grand.Web/Features/Handlers/Catalog/GetViewSortSizeOptionsHandler.cs @@ -38,7 +38,6 @@ public GetViewSortSizeOptionsHandler(ITranslationService translationService, Cat private void PrepareSortingOptions(GetViewSortSizeOptions request) { - ArgumentNullException.ThrowIfNull(request.PageSizeOptions); ArgumentNullException.ThrowIfNull(request.Command); var allDisabled = _catalogSettings.ProductSortingEnumDisabled.Count ==