Fix for nullreferenceexception when a TabbedPage is rendered without a set CurrentPag...
authorJoris Vergeer <jorisvergeer1992@gmail.com>
Fri, 3 Mar 2017 12:25:49 +0000 (13:25 +0100)
committerRui Marinho <me@ruimarinho.net>
Thu, 9 Mar 2017 10:02:22 +0000 (10:02 +0000)
Xamarin.Forms.Platform.iOS/Renderers/TabbedRenderer.cs

index 2749276..1ce4840 100644 (file)
@@ -233,7 +233,11 @@ namespace Xamarin.Forms.Platform.iOS
 
                public override UIViewController ChildViewControllerForStatusBarHidden()
                {
-                       return GetViewController(Tabbed.CurrentPage);
+                       var current = Tabbed.CurrentPage;
+                       if (current == null)
+                               return null;
+
+                       return GetViewController(current);
                }
 
                void UpdateCurrentPagePreferredStatusBarUpdateAnimation()