[Pkg-javascript-commits] [leaflet] 36/78: Fixed FeatureGroup crash

Jonas Smedegaard dr at jones.dk
Sat May 7 08:58:45 UTC 2016


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository leaflet.

commit 0532055215da1d682338e5699b9ef57f5b393ced
Author: Lambdac0re <Lambdac0re at users.noreply.github.com>
Date:   Fri Sep 25 10:55:11 2015 +0200

    Fixed FeatureGroup crash
    
    Now a LayerGroup can be removed from a FeatureGroup without crashing. FeatureGroup's addLayer had the check in place, but removeLayer did not!
---
 src/layer/FeatureGroup.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/layer/FeatureGroup.js b/src/layer/FeatureGroup.js
index dbff15d..7bfe8eb 100644
--- a/src/layer/FeatureGroup.js
+++ b/src/layer/FeatureGroup.js
@@ -36,7 +36,9 @@ L.FeatureGroup = L.LayerGroup.extend({
 			layer = this._layers[layer];
 		}
 
-		layer.off(L.FeatureGroup.EVENTS, this._propagateEvent, this);
+		if ('off' in layer) {
+			layer.off(L.FeatureGroup.EVENTS, this._propagateEvent, this);
+		}
 
 		L.LayerGroup.prototype.removeLayer.call(this, layer);
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/leaflet.git



More information about the Pkg-javascript-commits mailing list