dotnet / dotnet/wpf

NullReferenceException in MS.Internal.PrePostDescendentsWalker`1._VisitNode

Open
#10,972 1 comment 0 reactions 0 assignees View on GitHub
Needs minimal repro project needs more information
Dominant language
C#
Stars
7.7k
Forks
1.3k
Avg merge
1d 11h
Merged PRs (30d)
61

Description

### Description

A NullReferenceException can occur in MS.Internal.PrePostDescendentsWalker`1._VisitNode when System.Windows.TreeWalkHelper.InvalidateOnTreeChange is called after a logical/visual tree change.

### Reproduction Steps

Unclear how this exception occurs, but has something to do with resource lookups on an element that is no longer in the logical tree.

### Expected behavior

No null reference exception occures internally. Rather no null reference is passed or an exception is thrown highlighting the root cause.

### Actual behavior

A NullReferenceException goes unhandled

### Regression?

_No response_

### Known Workarounds

_No response_

### Impact

_No response_

### Configuration

_No response_

### Other information

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.