summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.iOS
diff options
context:
space:
mode:
authorSamantha Houts <samhouts@users.noreply.github.com>2017-03-27 10:31:04 (GMT)
committerRui Marinho <me@ruimarinho.net>2017-03-27 10:31:04 (GMT)
commit1eae24b051061227347f592d092806cab12f31e6 (patch)
treef901d46fd2794ccab0319da2392879c43203071a /Xamarin.Forms.Platform.iOS
parent9dcce94937584e1ccbf52371736ee3b712f5107f (diff)
downloadxamarin-forms-1eae24b051061227347f592d092806cab12f31e6.zip
xamarin-forms-1eae24b051061227347f592d092806cab12f31e6.tar.gz
xamarin-forms-1eae24b051061227347f592d092806cab12f31e6.tar.bz2
[iOS] Prevent NRE when page is switched on Appearing (#840)
Diffstat (limited to 'Xamarin.Forms.Platform.iOS')
-rw-r--r--Xamarin.Forms.Platform.iOS/Renderers/PageRenderer.cs3
1 files changed, 3 insertions, 0 deletions
diff --git a/Xamarin.Forms.Platform.iOS/Renderers/PageRenderer.cs b/Xamarin.Forms.Platform.iOS/Renderers/PageRenderer.cs
index e5e7d70..f7e3127 100644
--- a/Xamarin.Forms.Platform.iOS/Renderers/PageRenderer.cs
+++ b/Xamarin.Forms.Platform.iOS/Renderers/PageRenderer.cs
@@ -200,6 +200,9 @@ namespace Xamarin.Forms.Platform.iOS
void UpdateStatusBarPrefersHidden()
{
+ if (Element == null)
+ return;
+
var animation = ((Page)Element).OnThisPlatform().PreferredStatusBarUpdateAnimation();
if (animation == PageUIStatusBarAnimation.Fade || animation == PageUIStatusBarAnimation.Slide)
UIView.Animate(0.25, () => SetNeedsStatusBarAppearanceUpdate());