Added check for exsiting intermediates

This commit is contained in:
PaulStets 2018-01-29 15:22:47 +02:00
parent f859aee1a3
commit fd88fd347d

View file

@ -251,10 +251,14 @@ public class PointNavigationLayer extends OsmandMapLayer implements
newTargetPoint = targetPointsHelper.getPointToNavigate();
} else if (oldPoint.intermediate) {
List<TargetPoint> points = targetPointsHelper.getIntermediatePointsWithTarget();
newTargetPoint = new TargetPoint(position,
new PointDescription(PointDescription.POINT_TYPE_LOCATION, ""));
points.set(points.indexOf(oldPoint), newTargetPoint);
targetPointsHelper.reorderAllTargetPoints(points, true);
int i = points.indexOf(oldPoint);
if (i != -1) {
newTargetPoint = new TargetPoint(position,
new PointDescription(PointDescription.POINT_TYPE_LOCATION, ""));
points.set(i, newTargetPoint);
targetPointsHelper.reorderAllTargetPoints(points, true);
}
}
result = true;
}