From 9bbe4152e93940dc394ac4a7d00b05023185bc22 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Tue, 26 Feb 2013 19:46:24 -0500 Subject: [PATCH] Safely access entity.user, fixes bug via GA --- js/id/ui/contributors.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/id/ui/contributors.js b/js/id/ui/contributors.js index bd9e43503..2cf291886 100644 --- a/js/id/ui/contributors.js +++ b/js/id/ui/contributors.js @@ -4,9 +4,9 @@ iD.ui.Contributors = function(context) { limit = 4, entities = context.intersects(context.map().extent()); - for (var i in entities) { - if (entities[i].user) users[entities[i].user] = true; - } + entities.forEach(function(entity) { + if (entity && entity.user) users[entity.user] = true; + }); var u = Object.keys(users), subset = u.slice(0, u.length > limit ? limit - 1 : limit);