diff --git a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementEditingContext.java b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementEditingContext.java index 8517b88319..5ffca2ee76 100644 --- a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementEditingContext.java +++ b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementEditingContext.java @@ -180,8 +180,10 @@ public class MeasurementEditingContext { before.points.clear(); after.points.clear(); if (inSnapToRoadMode) { - beforeCacheForSnap.points.clear(); - afterCacheForSnap.points.clear(); + if (beforeCacheForSnap != null && afterCacheForSnap != null) { + beforeCacheForSnap.points.clear(); + afterCacheForSnap.points.clear(); + } needUpdateCacheForSnap = true; } else { beforeCacheForSnap = null; diff --git a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java index 993bb03000..f6f3919065 100644 --- a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java +++ b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java @@ -1395,7 +1395,7 @@ public class MeasurementToolFragment extends Fragment { hidePointsList(); return; } - if (editingCtx.getPointsCount() < 1 || saved) { + if (editingCtx.getPointsCount() == 0 || saved) { dismiss(mapActivity); return; }