Fix exiting from snap to road

This commit is contained in:
PavelRatushny 2017-09-04 10:25:14 +03:00
parent a70424f529
commit 1decb4e9fd
2 changed files with 5 additions and 3 deletions

View file

@ -180,8 +180,10 @@ public class MeasurementEditingContext {
before.points.clear(); before.points.clear();
after.points.clear(); after.points.clear();
if (inSnapToRoadMode) { if (inSnapToRoadMode) {
beforeCacheForSnap.points.clear(); if (beforeCacheForSnap != null && afterCacheForSnap != null) {
afterCacheForSnap.points.clear(); beforeCacheForSnap.points.clear();
afterCacheForSnap.points.clear();
}
needUpdateCacheForSnap = true; needUpdateCacheForSnap = true;
} else { } else {
beforeCacheForSnap = null; beforeCacheForSnap = null;

View file

@ -1395,7 +1395,7 @@ public class MeasurementToolFragment extends Fragment {
hidePointsList(); hidePointsList();
return; return;
} }
if (editingCtx.getPointsCount() < 1 || saved) { if (editingCtx.getPointsCount() == 0 || saved) {
dismiss(mapActivity); dismiss(mapActivity);
return; return;
} }