Skip to content

Commit af701b4

Browse files
fix npe crash (mapbox#318)
1 parent 5e2630a commit af701b4

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

mapbox/app/src/main/java/com/mapbox/services/android/testapp/nav/OffRouteDetectionActivity.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,9 @@ public void run() {
372372
} // End startSimulation
373373

374374
private void stopSimulation() {
375-
handler.removeCallbacks(runnable);
375+
if (handler != null && runnable != null) {
376+
handler.removeCallbacks(runnable);
377+
}
376378
}
377379

378380
public static double computeHeading(LatLng from, LatLng to) {

0 commit comments

Comments
 (0)