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

Commit 9e0da1a

Browse files
committed
Apply fix from #12114 to AppCompat
1 parent 2c0053d commit 9e0da1a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Xamarin.Forms.Platform.Android/AppCompat/Platform.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,13 @@ public static SizeRequest GetNativeSize(VisualElement view, double widthConstrai
184184
{
185185
Performance.Start(out string reference);
186186

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

189+
if (visualElementRenderer == null || visualElementRenderer.View.IsDisposed())
190+
{
191+
return new SizeRequest(Size.Zero, Size.Zero);
192+
}
193+
190194
var context = visualElementRenderer.View.Context;
191195

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

0 commit comments

Comments
 (0)