Skip to content

Fix: Crash on showing too many elements#4

Merged
fidarit merged 4 commits intofidarit:masterfrom
manuelmainz:fixes/309-crash-on-showing-too-many-elements
Nov 18, 2025
Merged

Fix: Crash on showing too many elements#4
fidarit merged 4 commits intofidarit:masterfrom
manuelmainz:fixes/309-crash-on-showing-too-many-elements

Conversation

@fidarit
Copy link
Owner

@fidarit fidarit commented Oct 30, 2025

Ported from AvaloniaUI#314 by @manuelmainz

avoid IndexOutOfRangeException by checking Count during loop

this is necessary because 'recycleElement(e, i + FirstIndex)' does modify the the elements

Cross link Issue AvaloniaUI#309

@fidarit
Copy link
Owner Author

fidarit commented Oct 30, 2025

I'm trying to reproduce the issue locally and will add a few tests to cover this case before merging

@fidarit
Copy link
Owner Author

fidarit commented Nov 18, 2025

Couldn't reproduce locally, but it's a tiny zero-overhead guard that prevents a possible IndexOutOfRange during recycling and literally can't hurt anything.. merging.
Thanks @manuelmainz!

@fidarit fidarit merged commit 8457511 into fidarit:master Nov 18, 2025
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