hasLayer not checking for null
Return false when checking for a null object in L.Map.hasLayer, in response to issue #1282.
This commit is contained in:
parent
a000304473
commit
109fd06ae6
@ -192,6 +192,8 @@ L.Map = L.Class.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
hasLayer: function (layer) {
|
hasLayer: function (layer) {
|
||||||
|
if (!layer) { return false; }
|
||||||
|
|
||||||
var id = L.stamp(layer);
|
var id = L.stamp(layer);
|
||||||
return this._layers.hasOwnProperty(id);
|
return this._layers.hasOwnProperty(id);
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user