summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.Android
diff options
context:
space:
mode:
authorRui Marinho <me@ruimarinho.net>2016-10-12 11:54:47 (GMT)
committerGitHub <noreply@github.com>2016-10-12 11:54:47 (GMT)
commita64333e29ea6138bc9adf0346e724f155eae3bc9 (patch)
tree01fbe76ece23e3071f507870236e406c48504a21 /Xamarin.Forms.Platform.Android
parent36d9dceb4f26cf1e068f153f811a34960bc36d68 (diff)
downloadxamarin-forms-a64333e29ea6138bc9adf0346e724f155eae3bc9.zip
xamarin-forms-a64333e29ea6138bc9adf0346e724f155eae3bc9.tar.gz
xamarin-forms-a64333e29ea6138bc9adf0346e724f155eae3bc9.tar.bz2
[Android] Fix possible NRE when detaching NavigationPageRenderer (#415)
Diffstat (limited to 'Xamarin.Forms.Platform.Android')
-rw-r--r--Xamarin.Forms.Platform.Android/Renderers/NavigationRenderer.cs6
1 files changed, 3 insertions, 3 deletions
diff --git a/Xamarin.Forms.Platform.Android/Renderers/NavigationRenderer.cs b/Xamarin.Forms.Platform.Android/Renderers/NavigationRenderer.cs
index 3fbfa09..c02dc42 100644
--- a/Xamarin.Forms.Platform.Android/Renderers/NavigationRenderer.cs
+++ b/Xamarin.Forms.Platform.Android/Renderers/NavigationRenderer.cs
@@ -74,13 +74,13 @@ namespace Xamarin.Forms.Platform.Android
protected override void OnAttachedToWindow()
{
base.OnAttachedToWindow();
- PageController.SendAppearing();
+ PageController?.SendAppearing();
}
protected override void OnDetachedFromWindow()
{
base.OnDetachedFromWindow();
- PageController.SendDisappearing();
+ PageController?.SendDisappearing();
}
protected override void OnElementChanged(ElementChangedEventArgs<NavigationPage> e)
@@ -145,7 +145,7 @@ namespace Xamarin.Forms.Platform.Android
void InsertPageBefore(Page page, Page before)
{
- int index = ((IPageController)Element).InternalChildren.IndexOf(before);
+ int index = PageController.InternalChildren.IndexOf(before);
if (index == -1)
throw new InvalidOperationException("This should never happen, please file a bug");