From 9cdf0cdd6614e65c6375b3561ad4f014ab0a156b Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Thu, 8 Jun 2017 13:13:46 -0400 Subject: [PATCH] Add explict check for prototype inheritance of entities Chrome bug (see #3973) --- modules/core/graph.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/core/graph.js b/modules/core/graph.js index 27b575164..7d168b35c 100644 --- a/modules/core/graph.js +++ b/modules/core/graph.js @@ -34,6 +34,12 @@ coreGraph.prototype = { entity: function(id) { var entity = this.entities[id]; + + //https://github.com/openstreetmap/iD/issues/3973#issuecomment-307052376 + if (!entity) { + entity = this.entities.__proto__[id]; + } + if (!entity) { throw new Error('entity ' + id + ' not found'); }