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);
|
updateRouteAndRefresh(updateRoute);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removeWayPoint(boolean updateRoute, int index){
|
public void removeWayPoint(boolean updateRoute, int index) {
|
||||||
|
int sz = intermediatePoints.size();
|
||||||
if (index < 0) {
|
if (index < 0) {
|
||||||
cancelTargetPointAddressRequest();
|
cancelTargetPointAddressRequest();
|
||||||
settings.clearPointToNavigate();
|
settings.clearPointToNavigate();
|
||||||
pointToNavigate = null;
|
pointToNavigate = null;
|
||||||
int sz = intermediatePoints.size();
|
|
||||||
if (sz > 0) {
|
if (sz > 0) {
|
||||||
settings.deleteIntermediatePoint(sz - 1);
|
settings.deleteIntermediatePoint(sz - 1);
|
||||||
pointToNavigate = intermediatePoints.remove(sz - 1);
|
pointToNavigate = intermediatePoints.remove(sz - 1);
|
||||||
|
@ -510,7 +510,7 @@ public class TargetPointsHelper {
|
||||||
pointToNavigate.pointDescription);
|
pointToNavigate.pointDescription);
|
||||||
lookupAddressForPointToNavigate();
|
lookupAddressForPointToNavigate();
|
||||||
}
|
}
|
||||||
} else {
|
} else if (sz > index) {
|
||||||
settings.deleteIntermediatePoint(index);
|
settings.deleteIntermediatePoint(index);
|
||||||
TargetPoint targetPoint = intermediatePoints.remove(index);
|
TargetPoint targetPoint = intermediatePoints.remove(index);
|
||||||
cancelPointAddressRequests(targetPoint.point);
|
cancelPointAddressRequests(targetPoint.point);
|
||||||
|
|
Loading…
Reference in a new issue