Skip to content

Commit

Permalink
Prevents calling setStyle with undefined argument
Browse files Browse the repository at this point in the history
Fixes the following error
```
TypeError: Cannot read property 'hasOwnProperty' of undefined
    at NewClass.setStyle (leaflet-src.js?9eb7:7853)
    at NewClass.removeHooks (leaflet.draw-src.js?2c0f:1967)
    at eval (leaflet.draw-src.js?2c0f:1833)
    at NewClass._eachVertexHandler (leaflet.draw-src.js?2c0f:1816)
    at NewClass.removeHooks (leaflet.draw-src.js?2c0f:1832)
    at NewClass.eval (leaflet.draw-src.js?2c0f:2302)
    at NewClass.fire (leaflet-src.js?9eb7:593)
    at NewClass.removeLayer (leaflet-src.js?9eb7:6681)
    at NewClass.removeLayer (leaflet-src.js?9eb7:6823)
    at NewClass.removeLayer (leaflet-src.js?9eb7:6969)
```
  • Loading branch information
same31 authored Sep 6, 2019
1 parent d5dd117 commit 6957199
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/edit/handler/Edit.Poly.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,9 @@ L.Edit.PolyVerticesEdit = L.Handler.extend({
}
}

poly.setStyle(poly.options.editing);
if (poly.options.editing) {
poly.setStyle(poly.options.editing);
}

if (this._poly._map) {

Expand Down

0 comments on commit 6957199

Please sign in to comment.