Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle NullPointerExceptions from getActiveNetworkInfo #1311

Merged
merged 2 commits into from
Jul 1, 2021

Conversation

lemnik
Copy link
Contributor

@lemnik lemnik commented Jun 30, 2021

Goal

Handle cases where ConnectivityManager.getActiveNetworkInfo throws a NullPointerException instead of returning null (as expected).

Design

Treat the NullPointerExceptions as null values, and leave all other exceptions to propagate as normal to avoid breaking existing error-handling logic.

Testing

Tested using mocking in unit tests as this has only been seen in very limited real-world situations.

@lemnik lemnik requested a review from fractalwrench June 30, 2021 15:22
@lemnik lemnik force-pushed the PLAT-6860/fix-connectivity-manager-exception branch from 28580a5 to 85ca690 Compare June 30, 2021 15:23
@lemnik lemnik force-pushed the PLAT-6860/fix-connectivity-manager-exception branch from 85ca690 to 1488b7c Compare June 30, 2021 15:30
Copy link
Contributor

@fractalwrench fractalwrench left a comment

Choose a reason for hiding this comment

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

LGTM pending CI

@lemnik lemnik merged commit 247b7a5 into next Jul 1, 2021
@lemnik lemnik deleted the PLAT-6860/fix-connectivity-manager-exception branch July 1, 2021 07:58
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