Skip to content

Commit

Permalink
Merge pull request #884 from sebastibe/inherited-arrays
Browse files Browse the repository at this point in the history
Protect against iterating over custom array
  • Loading branch information
tombatossals committed Aug 11, 2015
2 parents e090def + 19b3f5a commit 88257a1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/services/leafletIterators.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,9 @@ angular.module('leaflet-directive').service('leafletIterators', function ($log,
}
if(!_hasErrors(collection, externalCb)){
for(var key in collection){
internalCb(collection[key], key);
if (collection.hasOwnProperty(key)) {
internalCb(collection[key], key);
}
}
}
};
Expand Down

0 comments on commit 88257a1

Please sign in to comment.