[Android] Fix possible NRE when detaching NavigationPageRenderer #415

Merged
merged 1 commit into from Oct 12, 2016

Conversation

Projects
None yet
4 participants
@rmarinho
Member

rmarinho commented Oct 4, 2016

Description of Change

Check if PageController is null before calling it

Bugs Fixed

https://bugzilla.xamarin.com/show_bug.cgi?id=44175

PR Checklist

  • Has tests (if omitted, state reason in description)
  • Rebased on top of master at time of PR
  • Changes adhere to coding standard
  • Consolidate commits as makes sense
@StephaneDelcroix

When does this happen ? Could we have a test ?

@@ -145,7 +145,7 @@ protected virtual Task<bool> OnPushAsync(Page view, bool animated)
void InsertPageBefore(Page page, Page before)
{
- int index = ((IPageController)Element).InternalChildren.IndexOf(before);
+ int index = PageController.InternalChildren.IndexOf(before);

This comment has been minimized.

@StephaneDelcroix

StephaneDelcroix Oct 5, 2016

Member

and here, you do not check for null ?

@StephaneDelcroix

StephaneDelcroix Oct 5, 2016

Member

and here, you do not check for null ?

This comment has been minimized.

@rmarinho

rmarinho Oct 6, 2016

Member

this code was already in.. and isn't related.. and here Element with 99% will not be null

@rmarinho

rmarinho Oct 6, 2016

Member

this code was already in.. and isn't related.. and here Element with 99% will not be null

This comment has been minimized.

@StephaneDelcroix

StephaneDelcroix Oct 6, 2016

Member

99% not null... that's still a huge number of NRE...

@StephaneDelcroix

StephaneDelcroix Oct 6, 2016

Member

99% not null... that's still a huge number of NRE...

@rmarinho rmarinho merged commit a64333e into master Oct 12, 2016

3 of 5 checks passed

iOS10-UITests Finished TeamCity Build Xamarin.Forms :: Debug :: Cycle8 :: UI Tests :: OSX Test Cloud Package - Run iOS Unified iOS10 : Tests failed: 8 (…
Details
iOS9-UITests Finished TeamCity Build Xamarin.Forms :: Debug :: Cycle8 :: UI Tests :: OSX Test Cloud Package - Run iOS Unified iOS9 : Tests failed: 2 (1…
Details
Android-UITests Finished TeamCity Build Xamarin.Forms :: Debug :: Cycle8 :: UI Tests :: OSX Test Cloud Package - Run Android 6.0.1 : Tests passed: 348, ig…
Details
OSX-Debug-C8 Finished TeamCity Build Xamarin.Forms :: Debug :: Cycle8 :: OSX Debug : Running
Details
Windows-Debug-C8 Finished TeamCity Build Xamarin.Forms :: Debug :: Cycle8 :: Windows Debug : Tests passed: 3456, ignored: 8
Details

@rmarinho rmarinho deleted the fix-bugzilla44175 branch Dec 12, 2016

@samhouts samhouts added this to the 2.3.4 milestone Jun 27, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment