Stop deleting points once there are no more points left
Prevents "Uncaught TypeError: Cannot read property 'off' of null" in L.Routing.js
This commit is contained in:
parent
48f8fe3524
commit
29530919b5
1 changed files with 3 additions and 1 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue