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

StopTelemetryService obtainBoundInstances bug fix #221

Merged
merged 3 commits into from
Sep 25, 2018

Conversation

electrostat
Copy link
Contributor

@electrostat electrostat commented Sep 25, 2018

Under certain circumstances, telemetryService is null and causes a crash when calling obtainBoundInstances() within stopTelemetryService. Add in check to prevent crash.

Fixes #188

- add null check to prevent crash when stopping telemetry service under certain cirucmstances
@electrostat electrostat self-assigned this Sep 25, 2018
Copy link
Contributor

@andrlee andrlee left a comment

Choose a reason for hiding this comment

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

There are at least 5 other instances in this class where telemetryService is accessed without prior null check. Should we address these too?

@@ -468,9 +468,11 @@ private void unbindTelemetryService() {
private void stopTelemetryService() {
TelemetryLocationEnabler.LocationState telemetryLocationState = telemetryLocationEnabler
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't null check be at this line? as well as should we escape early?
if (telemetryService == null) { /* log error */ return; }

- change location of null check and return early to optimize system
- check telemetryService before making any changes
@electrostat electrostat merged commit 3373634 into master Sep 25, 2018
@electrostat electrostat deleted the aa-stop-telem-service-null-check branch September 25, 2018 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants