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

Commit

Permalink
[Material] Fixed Renderer's LayoutSubviews may cause NullReferenceExc…
Browse files Browse the repository at this point in the history
…eption on iOS. (#15670)

Co-authored-by: naokitaguchi <taguchi@frog-pod.com>
  • Loading branch information
P3PPP and naokitaguchi committed Feb 15, 2023
1 parent bab2c49 commit b28fb45
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Xamarin.Forms.Material.iOS/MaterialButtonRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ protected virtual void ApplyTheme()

protected virtual void ApplyThemeIfNeeded()
{
var bgBrush = Element.Background;
var bgBrush = Element?.Background;

if (Brush.IsNullOrEmpty(bgBrush))
return;
Expand Down
2 changes: 1 addition & 1 deletion Xamarin.Forms.Material.iOS/MaterialFrameRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ protected override void Dispose(bool disposing)

protected virtual void ApplyThemeIfNeeded()
{
var bgBrush = Element.Background;
var bgBrush = Element?.Background;

if (Brush.IsNullOrEmpty(bgBrush))
return;
Expand Down
2 changes: 1 addition & 1 deletion Xamarin.Forms.Material.iOS/MaterialTextManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public static void ApplyTheme(IMaterialTextField textField, IMaterialEntryRender

public static void ApplyThemeIfNeeded(IMaterialTextField textField, IMaterialEntryRenderer element)
{
var bgBrush = element.Background;
var bgBrush = element?.Background;

if (Brush.IsNullOrEmpty(bgBrush))
return;
Expand Down

0 comments on commit b28fb45

Please sign in to comment.