-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NRE in Automation Peers #122
Comments
@miguep Will this be part of the remaining diff of desktop framework 4.8 to .NET Core 3? |
@rladuca it is not part of that work |
I'm seeing a lot of these happen still, any reason this can't be looked at for 3.0? Stack from earlier today:
|
We've observed this failure in .NET Framework as well and do not believe this is new to Core. The WPF team's focus currently is on ensuring functional and performance parity between WPF in .NET Core and .NET Framework, once we meet that goal we can start looking into fixing some of these bugs |
Maybe quantify what "a lot" means. If the exception is rare in Desktop Framework and common in Core Framework that would still be a regression (in my opinion). |
Seeing the same issue here. WPF (Framework 4.8 and 4.7.2) Same stack trace more or less. Can't find the culprit. |
I suddenly started to get this every 2 seconds instead of once every other day of using the program. I turned on Framework source code debugging and the code fails on Yes, that's a null reference exception on the line that checks if an object is null. Not much else can be seen in the debugger. Here are the local variables Most notably I really can't understand why the code throws at that line. I suspect the symbols, binary and source are out of sync. |
This is during scrolling of a virtualized tree view when the peer tree view item has been scrolled away and there's no container matching the peer item. Here's a more relevant stack where ContainerFromItem returns null for an item, which propagates all the way down to ItemsControlAutomationPeer property which returns null and throws.
|
This line is clearly missing a null check for ItemsControlAutomationPeer: Line 532 in 03a85c0
|
To clarify: the peer that has its ItemsControlAutomationPeer null is: |
…Core() For virtualized tree views it can happen that we are calling GetNameCore() on an item that has been scrolled out of view and doesn't have an associated container. ItemContainerGenerator.GetContainerFromItem() returns null, and so ItemsControlAutomationPeer ends up being null as well. We're still going to retrieve the name from the item.ToString(), so it's much better than crashing here and aborting the entire layout pass.
This is a more impactful issue in WPF that impacts a lot of customers. Simple web search for ItemAutomationPeer.GetNameCore() will result in a lot of hits and a lot of people seeing this. We need to service .NET Framework 4.8 with this fix after testing. |
…#7115) For virtualized tree views it can happen that we are calling GetNameCore() on an item that has been scrolled out of view and doesn't have an associated container. ItemContainerGenerator.GetContainerFromItem() returns null, and so ItemsControlAutomationPeer ends up being null as well. We're still going to retrieve the name from the item.ToString(), so it's much better than crashing here and aborting the entire layout pass.
.NET Core 3 preview 1
This is from my telemetry and resulted in an app crash.
The text was updated successfully, but these errors were encountered: