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

Commit

Permalink
If the element's renderer has already been nulled or disposed, reques…
Browse files Browse the repository at this point in the history
…t zero space for it (#12114)

fixes #10801
  • Loading branch information
hartez authored Sep 16, 2020
1 parent 54a1679 commit 536ea6e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Xamarin.Forms.Platform.Android/Platform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1335,9 +1335,13 @@ public static SizeRequest GetNativeSize(VisualElement view, double widthConstrai
{
Performance.Start(out string reference);

// FIXME: potential crash
IVisualElementRenderer visualElementRenderer = 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 536ea6e

Please sign in to comment.