diff --git a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementEditingContext.java b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementEditingContext.java index 154a2044ad..940ee0f2ef 100644 --- a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementEditingContext.java +++ b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementEditingContext.java @@ -178,8 +178,9 @@ public class MeasurementEditingContext { } public WptPt removePoint(int position, boolean updateSnapToRoad) { - if(position < 0 || position > before.points.size()) + if (position < 0 || position >= before.points.size()) { return new WptPt(); + } WptPt pt = before.points.remove(position); if (updateSnapToRoad) { updateCacheForSnapIfNeeded(false);