Skip to content

Commit 2929bfb

Browse files
committed
Add range check in RouteController.updateIndexes
1 parent e7ead10 commit 2929bfb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/MapboxCoreNavigation/RouteController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,8 @@ open class RouteController: NSObject {
315315
if newLegIndex != progress.legIndex {
316316
progress.legIndex = newLegIndex
317317
}
318-
319-
if newStepIndex != progress.currentLegProgress.stepIndex {
318+
319+
if (newStepIndex != progress.currentLegProgress.stepIndex) && (newStepIndex < progress.currentLeg.steps.endIndex) {
320320
progress.currentLegProgress.stepIndex = newStepIndex
321321
}
322322

0 commit comments

Comments
 (0)