diff options
author | Samantha Houts <samhouts@users.noreply.github.com> | 2017-03-27 03:31:04 -0700 |
---|---|---|
committer | Rui Marinho <me@ruimarinho.net> | 2017-03-27 11:31:04 +0100 |
commit | 1eae24b051061227347f592d092806cab12f31e6 (patch) | |
tree | f901d46fd2794ccab0319da2392879c43203071a /Xamarin.Forms.Platform.iOS | |
parent | 9dcce94937584e1ccbf52371736ee3b712f5107f (diff) | |
download | xamarin-forms-1eae24b051061227347f592d092806cab12f31e6.tar.gz xamarin-forms-1eae24b051061227347f592d092806cab12f31e6.tar.bz2 xamarin-forms-1eae24b051061227347f592d092806cab12f31e6.zip |
[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.cs | 3 |
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 e5e7d706..f7e31272 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()); |