Skip to content

[WIP][iOS & Mac] Fix NullReferenceException in CollectionViewHandler2 after handler restore when property changes#36073

Draft
SubhikshaSf4851 wants to merge 1 commit into
dotnet:inflight/currentfrom
SubhikshaSf4851:fix-36010
Draft

[WIP][iOS & Mac] Fix NullReferenceException in CollectionViewHandler2 after handler restore when property changes#36073
SubhikshaSf4851 wants to merge 1 commit into
dotnet:inflight/currentfrom
SubhikshaSf4851:fix-36010

Conversation

@SubhikshaSf4851

Copy link
Copy Markdown
Contributor

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment whether this change resolves your issue. Thank you!

This pull request addresses a regression issue where CollectionViewHandler2 could throw a NullReferenceException if a layout property changed after the handler was disconnected and then reconnected. The fix ensures the internal cache is properly reinitialized, and new tests are added to verify the handler's stability in these scenarios.

Description of Change

Bug fix:

  • Ensured _layoutPropertyCache is reinitialized when subscribing to a new items layout in CollectionViewHandler2, preventing NullReferenceException after handler disconnect/reconnect cycles.

Testing improvements:

  • Added regression tests to confirm that changing properties on GridItemsLayout and LinearItemsLayout after a disconnect/restore cycle does not cause crashes in CollectionViewHandler2. These tests cover various property changes and validate the fix

Issues Fixed

Fixes #36010

Tested the behavior in the following platforms

  • Windows
  • Android
  • iOS
  • Mac
Before Issue Fix After Issue Fix
BeforeFix36010 AfterFix36010

…r handler restore when ItemsLayout property changes
@Tamilarasan-Paranthaman Tamilarasan-Paranthaman added platform/macos macOS / Mac Catalyst platform/ios area-controls-collectionview CollectionView, CarouselView, IndicatorView community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration labels Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-controls-collectionview CollectionView, CarouselView, IndicatorView community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration platform/ios platform/macos macOS / Mac Catalyst

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants