From e0846ced2d490a7c08ba909da3222037a815a198 Mon Sep 17 00:00:00 2001 From: danzel Date: Fri, 10 May 2013 09:35:55 +1200 Subject: [PATCH] Don't break if calling hasLayer with null. Fixes #170. Thanks @l0c0luke --- src/MarkerClusterGroup.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MarkerClusterGroup.js b/src/MarkerClusterGroup.js index 9f4ae759d..a46b1b752 100644 --- a/src/MarkerClusterGroup.js +++ b/src/MarkerClusterGroup.js @@ -261,7 +261,7 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({ //Returns true if the given layer is in this MarkerClusterGroup hasLayer: function (layer) { - if (layer._noHas) { + if (!layer || layer._noHas) { return false; }