[Pkg-javascript-commits] [leaflet-markercluster] 375/479: White space formatting and make sure we don't hit null if the parent isn't visible.
Jonas Smedegaard
dr at jones.dk
Thu Oct 16 16:00:59 UTC 2014
This is an automated email from the git hooks/post-receive script.
js pushed a commit to branch master
in repository leaflet-markercluster.
commit 8807a0c3a20f87e0bb3a031637180a855abda44a
Author: danzel <danzel at localhost.geek.nz>
Date: Fri Jun 21 15:15:01 2013 +1200
White space formatting and make sure we don't hit null if the parent isn't visible.
---
src/MarkerClusterGroup.js | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/src/MarkerClusterGroup.js b/src/MarkerClusterGroup.js
index fa30630..d2b2683 100644
--- a/src/MarkerClusterGroup.js
+++ b/src/MarkerClusterGroup.js
@@ -390,14 +390,13 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
this._map = null;
},
- getVisibleParent: function(marker){
- var vMarker = marker;
- // TODO: Is this safe? No extra check needed to prevent infinite loop?
- while(!vMarker._icon) {
- vMarker = vMarker.__parent;
- }
- return vMarker;
- },
+ getVisibleParent: function(marker){
+ var vMarker = marker;
+ while(vMarker !== null && !vMarker._icon) {
+ vMarker = vMarker.__parent;
+ }
+ return vMarker;
+ },
//Remove the given object from the given array
_arraySplice: function (anArray, obj) {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/leaflet-markercluster.git
More information about the Pkg-javascript-commits
mailing list