Skip to content

Commit

Permalink
Add check for empty queue
Browse files Browse the repository at this point in the history
  • Loading branch information
danesfeder committed May 31, 2018
1 parent 26dc367 commit 954867c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,6 @@ public void onProgressChange(Location location, RouteProgress routeProgress) {
@Override
public void userOffRoute(Location location) {
if (hasNetworkConnection()) {
instructionPlayer.onOffRoute();
Point newOrigin = Point.fromLngLat(location.getLongitude(), location.getLatitude());
sendEventOffRoute(newOrigin);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public void onDestroy() {
@Override
public void onStart() {
requestAudioFocus();
instructionQueue.remove();
instructionQueue.poll();
}

@Override
Expand All @@ -69,7 +69,7 @@ public void onError(boolean isMapboxPlayer) {
if (isMapboxPlayer) {
androidSpeechPlayer.play(instructionQueue.peek().getAnnouncement());
} else {
instructionQueue.remove();
instructionQueue.poll();
}
}

Expand Down

0 comments on commit 954867c

Please sign in to comment.