From a4098fb234d04ac9f10b5ef7647e0114abe1db23 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Fri, 11 Sep 2020 17:51:36 +0300 Subject: [PATCH] Fix #9772 --- .../osmand/plus/measurementtool/MeasurementEditingContext.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementEditingContext.java b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementEditingContext.java index e365348586..105c947ddc 100644 --- a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementEditingContext.java +++ b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementEditingContext.java @@ -743,7 +743,7 @@ public class MeasurementEditingContext { locations.add(l); } pair.second.setTrkPtIndex(locations.size() - 1); - if (i < size - 2) { + if (i < size - 2 && !locations.isEmpty()) { locations.remove(locations.size() - 1); } route.addAll(data.segments);