Fix NRE for 7301 (#7706)
authorkingces95 <kingces95@users.noreply.github.com>
Fri, 27 Sep 2019 20:28:46 +0000 (10:28 -1000)
committerGitHub <noreply@github.com>
Fri, 27 Sep 2019 20:28:46 +0000 (10:28 -1000)
Xamarin.Forms.Platform.Android/AppCompat/FormsAppCompatActivity.cs

index 965fc39..f8dc1b6 100644 (file)
@@ -218,9 +218,11 @@ namespace Xamarin.Forms.Platform.Android
 
                        PopupManager.Unsubscribe(this);
 
-                       _layout.RemoveView(Platform);
-
-                       Platform?.Dispose();
+                       if (Platform != null)
+                       {
+                               _layout.RemoveView(Platform);
+                               Platform.Dispose();
+                       }
 
                        PreviousActivityDestroying.Set();