This commit is contained in:
max-klaus 2020-01-17 16:26:11 +03:00
parent fd843612ba
commit 4b4d1e0e2f

View file

@ -178,8 +178,9 @@ public class MeasurementEditingContext {
} }
public WptPt removePoint(int position, boolean updateSnapToRoad) { public WptPt removePoint(int position, boolean updateSnapToRoad) {
if(position < 0 || position > before.points.size()) if (position < 0 || position >= before.points.size()) {
return new WptPt(); return new WptPt();
}
WptPt pt = before.points.remove(position); WptPt pt = before.points.remove(position);
if (updateSnapToRoad) { if (updateSnapToRoad) {
updateCacheForSnapIfNeeded(false); updateCacheForSnapIfNeeded(false);