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

Consolidate InstructionView DistanceFormatters #1174

Merged
merged 1 commit into from Aug 3, 2018

Conversation

danesfeder
Copy link
Contributor

Closes #1169

Found a couple things stemming from the crash in the ticket. For context, the developer was using the MapMatching API, which looks like wasn't providing a RouteOptions#voiceUnit. We were letting this pass all the way through to the InstructionListPresenter which was eventually throwing an NPE.

To fix this, I re-worked some of the logic around the DistanceFormatter in InstructionView and created a new util for retrieving a non-null String unitType.

We now ignore null unit types or languages and create a new DistanceFormatter in the InstructionView only when necessary. The presenter is then updated with the new formatter if needed.

cc @riastrad

@danesfeder danesfeder merged commit 93cf745 into master Aug 3, 2018
@danesfeder danesfeder deleted the dan-instruction-list-npe branch August 3, 2018 17:20
@Guardiola31337 Guardiola31337 mentioned this pull request Aug 10, 2018
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Defect to be fixed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NullPointerException when using MapMatching Route
2 participants