Skip to content

Commit

Permalink
Merge pull request AvaloniaUI#8391 from AvaloniaUI/DirectBindingSubsc…
Browse files Browse the repository at this point in the history
…ription-NRE

Fix DirectBindingSubscription NRE
  • Loading branch information
kekekeks authored and danwalmsley committed Jul 6, 2022
1 parent 3878b13 commit 1c13b70
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Avalonia.Base/AvaloniaObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -916,7 +916,8 @@ public DirectBindingSubscription(

public void Dispose()
{
_subscription.Dispose();
// _subscription can be null, if Subscribe failed with an exception.
_subscription?.Dispose();
_owner._directBindings!.Remove(this);
}

Expand Down

0 comments on commit 1c13b70

Please sign in to comment.