Open Larhei opened 3 weeks ago
Hi I'm an AI powered bot that finds similar issues based off the issue title.
Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!
CollectionView
throws NRE when ScrollTo
method is called from a handler of event Window.Created
(#17865), similarity score: 0.78Note: You can give me feedback by thumbs upping or thumbs downing this comment.
I can repro this issue at Windows platform on the latest 17.12.0 Preview 1.0(8.0.80 & 8.0.72).
Description
When adding an item to an Observable Collection in my ViewModel and than try to scroll to it, i´m getting a Nullpointer from the ListViewRenderer from time to time. To illustrate the issue i wrote some code that does not make sense in real world but it illustrates the issue. Looks like a race condition to me. The item is in the Itemssource on maui side... but not in the native side of things. But this is just a guess. On Android it is not crashing, but logcat is giving also nullpointer logs.
Steps to Reproduce
Link to public reproduction project repository
https://github.com/Larhei/Maui-Issues/tree/main/ScrollToNullPointer
Version with bug
8.0.80 SR8
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
Windows
Affected platform versions
net8.0-windows10.0.19041.0
Did you find any workaround?
Addind a delay between adding to the collection and call to ScrollTo stops the Nullpointer from happening. But in case UI-Thread is busy this could lead again to this nullpointer i guess.
Relevant log output