Skip to content

fix: storefront category/brand/collection page crashes when PageSizeOptions is empty - #800

Merged
KrzysztofPajak merged 1 commit into
developfrom
fix/category-page-size-options-null-throw
Aug 28, 2026
Merged

fix: storefront category/brand/collection page crashes when PageSizeOptions is empty#800
KrzysztofPajak merged 1 commit into
developfrom
fix/category-page-size-options-null-throw

Conversation

@KrzysztofPajak

Copy link
Copy Markdown
Member

Summary

  • Fixes an ArgumentNullException thrown on the storefront whenever a Category/Brand/Collection/Vendor/ProductTag's admin Page size options field is left empty.
  • Root cause: GetViewSortSizeOptionsHandler.PrepareSortingOptions() had a stray ArgumentNullException.ThrowIfNull(request.PageSizeOptions) guard, even though that method never reads PageSizeOptions. The actual consumer, PreparePageSizeOptions(), already handles null/empty correctly and falls back to the entity's default page size.

Change

  • Removed the misplaced guard in GetViewSortSizeOptionsHandler.PrepareSortingOptions.

Testing

  • dotnet build src/Web/Grand.Web/Grand.Web.csproj — succeeded, 0 errors.

🤖 Generated with Claude Code

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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QArzgnTu2jhTmm4LiMjuNF
Copilot AI lite review requested due to automatic review settings August 28, 2026 13:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@KrzysztofPajak
KrzysztofPajak merged commit a6bb196 into develop Aug 28, 2026
6 checks passed
@KrzysztofPajak
KrzysztofPajak deleted the fix/category-page-size-options-null-throw branch August 28, 2026 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants