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

Commit

Permalink
Apply fix from #12114 to AppCompat (#14933)
Browse files Browse the repository at this point in the history
  • Loading branch information
jfversluis committed Dec 1, 2021
1 parent 8d9c07b commit eea2c1d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Xamarin.Forms.Platform.Android/AppCompat/Platform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,13 @@ public static SizeRequest GetNativeSize(VisualElement view, double widthConstrai
{
Performance.Start(out string reference);

// FIXME: potential crash
IVisualElementRenderer visualElementRenderer = Android.Platform.GetRenderer(view);

if (visualElementRenderer == null || visualElementRenderer.View.IsDisposed())
{
return new SizeRequest(Size.Zero, Size.Zero);
}

var context = visualElementRenderer.View.Context;

// negative numbers have special meanings to android they don't to us
Expand Down

0 comments on commit eea2c1d

Please sign in to comment.