dotnet / dotnet/wpf

NullReferenceException in DeferredAppResourceReference.GetValue

Open
#7,802 1 comment 0 reactions 0 assignees View on GitHub
Bug needs more information
Dominant language
C#
Stars
7.7k
Forks
1.3k
Avg merge
1d 11h
Merged PRs (30d)
61

Description

### Description

Sorry, this is not a good report. I received an exception stack from the user, without more information and repeat steps. The application hangs after this exception. The exception stack:

```
System.NullReferenceException: Object reference not set to an instance of an object.
in object DeferredAppResourceReference.GetValue(BaseValueSourceInternal valueSource)
in object DependencyPropertyChangedEventArgs.get_OldValue()
in void Image.OnSourceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
in void DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
in void FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
in void DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
in UpdateResult DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, ref EffectiveValueEntry newEntry, bool coerceWithDeferredReference, bool coerceWithCurrentValue, Op...
in void DependencyObject.InvalidateProperty(DependencyProperty dp, bool preserveCurrentValue) x 2
in void ResourceReferenceExpression.InvalidateTargetProperty(object sender, EventArgs e)
in void ResourceReferenceExpression.InvalidateExpressionValue(object sender, EventArgs e)
in void TreeWalkHelper.InvalidateResourceReferences(DependencyObject d, ResourcesChangeInfo info)
in void TreeWalkHelper.OnResourcesChanged(DependencyObject d, ResourcesChangeInfo info, bool raiseResourceChangedEvent)
in void FrameworkElement.OnAncestorChangedInternal(TreeChangeInfo parentTreeState)
in bool TreeWalkHelper.OnAncestorChanged(DependencyObject d, TreeChangeInfo info, bool visitedViaVisualTree)
in void PrePostDescendentsWalker._VisitNode(DependencyObject d, bool visitedViaVisualTree)
in void DescendentsWalker.VisitNode(FrameworkElement fe, bool visitedViaVisualTree) x 2
in void DescendentsWalker.WalkLogicalChildren(FrameworkElement feParent, FrameworkContentElement fceParent, IEnumerator logicalChildren)
in void DescendentsWalker.WalkFrameworkElementLogicalThenVisualChildren(FrameworkElement feParent, bool hasLogicalChildren)
in void DescendentsWalker.IterateChildren(DependencyObject d)
in void DescendentsWalker.StartWalk(DependencyObject startNode, bool skipStartNode)
in void PrePostDescendentsWalker.StartWalk(DependencyObject startNode, bool skipStartNode)
in void TreeWalkHelper.InvalidateOnTreeChange(FrameworkElement fe, FrameworkContentElement fce, DependencyObject parent, bool isAddOperation)
in void FrameworkElement.ChangeLogicalParent(DependencyObject newParent)
in void FrameworkElement.AddLogicalChild(object child)
in void ContentControl.OnContentChanged(object oldContent, object newContent) x 2
in void DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
in void FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
in void DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
in UpdateResult DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, ref EffectiveValueEntry newEntry, bool coerceWithDeferredReference, bool coerceWithCurrentValue, Op...
in void DependencyObject.InvalidateProperty(DependencyProperty dp, bool preserveCurrentValue) x 2
in void BindingExpressionBase.Invalidate(bool isASubPropertyChange)
in void BindingExpression.TransferValue(object newValue, bool isASubPropertyChange)
in void BindingExpression.Activate(object item)
in void BindingExpression.AttachToContext(AttachAttempt attempt)
in bool BindingExpression.MS.Internal.Data.IDataBindEngineClient.AttachToContext(bool lastChance)
in void Task.Run(bool lastChance)
in object DataBindEngine.Run(object arg)
in void DataBindEngine.OnLayoutUpdated(object sender, EventArgs e)
in void ContextLayoutManager.fireLayoutUpdateEvent()
in void ContextLayoutManager.UpdateLayout()
in object ContextLayoutManager.UpdateLayoutCallback(object arg)
in void MediaContext.FireInvokeOnRenderCallbacks()
in void MediaContext.RenderMessageHandlerCore(object resizedCompositionTarget)
in object MediaContext.AnimatedRenderMessageHandler(object resizedCompositionTarget)
in object ExceptionWrapper.InternalRealCall(Delegate callback, object args, int numArgs)
in object ExceptionWrapper.TryCatchWhen(object source, Delegate callback, object args, int numArgs, Delegate catchHandler)
```

### Reproduction Steps

None.

### Expected behavior

The application work well or throw the clear error message.

### Actual behavior

The application hangs.

### 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.