Avoid out of bound exception

This commit is contained in:
Victor Shcherb 2017-04-16 13:12:09 +03:00
parent af7d034592
commit 2c6dc292a8

View file

@ -1092,7 +1092,8 @@ public class RouteProvider {
for (int i = cDirInfo; i < directionInfo.size(); i++) {
RouteDirectionInfo dirInfo = directionInfo.get(i);
if (dirInfo.routePointOffset - routePointOffsetAdjusted >= cRoute) {
if (dirInfo.getTurnType() != null && !dirInfo.getTurnType().isSkipToSpeak()) {
if (dirInfo.getTurnType() != null && !dirInfo.getTurnType().isSkipToSpeak() &&
dirInfo.routePointOffset - routePointOffsetAdjusted < routeNodes.size()) {
Location loc = routeNodes.get(dirInfo.routePointOffset - routePointOffsetAdjusted);
WptPt pt = new WptPt();
pt.lat = loc.getLatitude();