Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Commit

Permalink
Fix NRE VisualElement Background when is null (#15299)
Browse files Browse the repository at this point in the history
  • Loading branch information
jfversluis committed Apr 11, 2022
1 parent e967c7a commit e291e7e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Xamarin.Forms.Core/VisualElement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,10 @@ void NotifyBackgroundChanges()
{
Device.InvokeOnMainThreadAsync(() =>
{
Background.Parent = this;
if (Background != null)
{
Background.Parent = this;
}
});

Background.PropertyChanged += OnBackgroundChanged;
Expand Down

0 comments on commit e291e7e

Please sign in to comment.