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

Fix mock location engine crash #492

Closed
cammace opened this issue Jun 26, 2017 · 1 comment
Closed

Fix mock location engine crash #492

cammace opened this issue Jun 26, 2017 · 1 comment
Assignees
Labels

Comments

@cammace
Copy link
Contributor

cammace commented Jun 26, 2017

If a route isn't provided to the mock location engine but you call moveToLocation() eventually the activity will crash with this in the log output:

java.lang.NullPointerException: Attempt to invoke virtual method 'java.util.List com.mapbox.services.api.directions.v5.models.DirectionsRoute.getLegs()' on a null object reference
                                                                                          at com.mapbox.services.android.location.MockLocationEngine.calculateStepPoints(MockLocationEngine.java:304)
                                                                                          at com.mapbox.services.android.location.MockLocationEngine.access$200(MockLocationEngine.java:32)
                                                                                          at com.mapbox.services.android.location.MockLocationEngine$LocationUpdateRunnable.run(MockLocationEngine.java:357)
                                                                                          at android.os.Handler.handleCallback(Handler.java:769)
                                                                                          at android.os.Handler.dispatchMessage(Handler.java:98)
                                                                                          at android.os.Looper.loop(Looper.java:164)
                                                                                          at android.app.ActivityThread.main(ActivityThread.java:6535)
                                                                                          at java.lang.reflect.Method.invoke(Native Method)
                                                                                          at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
                                                                                          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
@cammace cammace added the Bug label Jun 26, 2017
@cammace cammace self-assigned this Jun 26, 2017
@cammace
Copy link
Contributor Author

cammace commented Oct 30, 2017

Should be fixed or will be fixed in the Navigation repo where the mock location engine will live from here on out.

@cammace cammace closed this as completed Oct 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant