diff --git a/js/plugin/Routing.js b/js/plugin/Routing.js index 38005f4..f0ee5ab 100644 --- a/js/plugin/Routing.js +++ b/js/plugin/Routing.js @@ -378,7 +378,9 @@ BR.Routing = L.Routing.extend({ }, deleteLastPoint: function() { - this.removeWaypoint(this.getLast(), function(err, data) {}); + if ((lastPoint = this.getLast())) { + this.removeWaypoint(lastPoint, function(err, data) {}); + } }, _removeDistanceMarkers: function() {