mapbox / mapbox/mapbox-navigation-android

RouteLineDistancesIndex.getPoint() NullPointerException

Open
#3,690 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

archived bug UI
Dominant language
Kotlin
Stars
651
Forks
321
PR merge metrics
No merged PRs in 30d

Description

### Steps to trigger behavior

Unknown at this time. I just ran into it while testing on the main branch.

### Issue

```
2020-10-26 12:10:21.310 9969-9969/com.mapbox.navigation.examples E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.mapbox.navigation.examples, PID: 9969
java.lang.NullPointerException: Attempt to invoke virtual method 'com.mapbox.geojson.Point com.mapbox.navigation.ui.route.RouteLineDistancesIndex.getPoint()' on a null object reference
at com.mapbox.navigation.ui.route.MapRouteLine.updateTraveledRouteLine(MapRouteLine.kt:1052)
at com.mapbox.navigation.ui.route.NavigationMapRoute$1.onIndicatorPositionChanged(NavigationMapRoute.java:343)
at com.mapbox.mapboxsdk.location.LocationComponent$10.onIndicatorPositionChanged(LocationComponent.java:1880)
at com.mapbox.mapboxsdk.location.LocationLayerController$1.onNewAnimationValue(LocationLayerController.java:269)
at com.mapbox.mapboxsdk.location.LocationLayerController$1.onNewAnimationValue(LocationLayerController.java:265)
at com.mapbox.mapboxsdk.location.MapboxAnimator.postUpdates(MapboxAnimator.java:106)
at com.mapbox.mapboxsdk.location.MapboxAnimator.onAnimationUpdate(MapboxAnimator.java:93)
at android.animation.ValueAnimator.animateValue(ValueAnimator.java:1566)
at android.animation.ValueAnimator.animateBasedOnTime(ValueAnimator.java:1357)
at android.animation.ValueAnimator.doAnimationFrame(ValueAnimator.java:1489)
at android.animation.ValueAnimator.pulseAnimationFrame(ValueAnimator.java:1508)
at android.animation.AnimatorSet.pulseFrame(AnimatorSet.java:1170)
at android.animation.AnimatorSet.doAnimationFrame(AnimatorSet.java:1061)
at android.animation.AnimationHandler.doAnimationFrame(AnimationHandler.java:146)
at android.animation.AnimationHandler.access$100(AnimationHandler.java:37)
at android.animation.AnimationHandler$1.doFrame(AnimationHandler.java:54)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:970)
at android.view.Choreographer.doCallbacks(Choreographer.java:796)
at android.view.Choreographer.doFrame(Choreographer.java:727)
```

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at MapRouteLine.kt:1052, where updateTraveledRouteLine triggers the null dereference, and trace the callback from NavigationMapRoute.java:343 through the location callbacks. Establish a reproducible route-update scenario from the stack trace, then verify that indicator updates no longer crash when the distance index is unavailable.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.