From 4b4d1e0e2ffca8c1ec63d10be9e494b8a0534a1c Mon Sep 17 00:00:00 2001 From: max-klaus Date: Fri, 17 Jan 2020 16:26:11 +0300 Subject: [PATCH] Fix #8101 --- .../osmand/plus/measurementtool/MeasurementEditingContext.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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);