Fix removeWayPoint crash
This commit is contained in:
parent
5342d4a0e2
commit
a262a13fbf
1 changed files with 3 additions and 3 deletions
|
@ -496,12 +496,12 @@ public class TargetPointsHelper {
|
|||
updateRouteAndRefresh(updateRoute);
|
||||
}
|
||||
|
||||
public void removeWayPoint(boolean updateRoute, int index){
|
||||
public void removeWayPoint(boolean updateRoute, int index) {
|
||||
int sz = intermediatePoints.size();
|
||||
if (index < 0) {
|
||||
cancelTargetPointAddressRequest();
|
||||
settings.clearPointToNavigate();
|
||||
pointToNavigate = null;
|
||||
int sz = intermediatePoints.size();
|
||||
if (sz > 0) {
|
||||
settings.deleteIntermediatePoint(sz - 1);
|
||||
pointToNavigate = intermediatePoints.remove(sz - 1);
|
||||
|
@ -510,7 +510,7 @@ public class TargetPointsHelper {
|
|||
pointToNavigate.pointDescription);
|
||||
lookupAddressForPointToNavigate();
|
||||
}
|
||||
} else {
|
||||
} else if (sz > index) {
|
||||
settings.deleteIntermediatePoint(index);
|
||||
TargetPoint targetPoint = intermediatePoints.remove(index);
|
||||
cancelPointAddressRequests(targetPoint.point);
|
||||
|
|
Loading…
Reference in a new issue