fix crash when deleting points too fast

This commit is contained in:
jensMF 2019-12-17 15:19:33 +01:00
parent 094781ad9a
commit cf8dec2c92

View file

@ -178,6 +178,8 @@ public class MeasurementEditingContext {
} }
public WptPt removePoint(int position, boolean updateSnapToRoad) { public WptPt removePoint(int position, boolean updateSnapToRoad) {
if(position < 0 || position > before.points.size())
return new WptPt();
WptPt pt = before.points.remove(position); WptPt pt = before.points.remove(position);
if (updateSnapToRoad) { if (updateSnapToRoad) {
updateCacheForSnapIfNeeded(false); updateCacheForSnapIfNeeded(false);