Skip to content

Prevent NPE on onHostResume - #9

Open
firefueled wants to merge 2 commits into
mybigday:masterfrom
universo-mw8:prevent-npe-on-host-resume
Open

Prevent NPE on onHostResume#9
firefueled wants to merge 2 commits into
mybigday:masterfrom
universo-mw8:prevent-npe-on-host-resume

Conversation

@firefueled

Copy link
Copy Markdown

This call to helper.onResume() was causing intermittent NPE's
They happened during app initialization but I could not identify the reason; usually after a reload
Adding a null check on onHostPause as well, just in case

This call to helper.onResume() was causing intermitent NPE's
They happened during app initialization but I could not identify the reason; usually after a reload
@jhen0409

Copy link
Copy Markdown
Member

If helper is null, it means start() may also do something unexpected. I think we need to track this problem.

helper.onPause();
// Don't know why this would be null at this point
if (helper != null) {
helper.onResume();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

onPause, and shouldn't need to handle this event?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that onPause shouldn't need that verification. I added it just as a precaution. I've never had an NPE pointing to onPause.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants