diff --git a/js/id/actions/circularize.js b/js/id/actions/circularize.js index 86a6bc489..08f59f078 100644 --- a/js/id/actions/circularize.js +++ b/js/id/actions/circularize.js @@ -59,7 +59,7 @@ iD.actions.Circularize = function(wayId, projection, count) { }; action.disabled = function(graph) { - if (!graph.entity(wayId).isClosed()) + if (!graph.entity(wayId, true).isClosed()) return 'not_closed'; }; diff --git a/js/id/actions/orthogonalize.js b/js/id/actions/orthogonalize.js index 54f3814d5..de286b808 100644 --- a/js/id/actions/orthogonalize.js +++ b/js/id/actions/orthogonalize.js @@ -128,7 +128,7 @@ iD.actions.Orthogonalize = function(wayId, projection) { }; action.disabled = function(graph) { - if (!graph.entity(wayId).isClosed()) + if (!graph.entity(wayId, true).isClosed()) return 'not_closed'; }; diff --git a/js/id/core/graph.js b/js/id/core/graph.js index 8a493aaac..dab6298e4 100644 --- a/js/id/core/graph.js +++ b/js/id/core/graph.js @@ -31,8 +31,12 @@ iD.Graph = function(other, mutable) { }; iD.Graph.prototype = { - entity: function(id) { - return this.entities[id]; + entity: function(id, log) { + var entity = this.entities[id]; + if (!entity && log && typeof Raven !== 'undefined') { + Raven.captureMessage('entity not found', {tags: {id: id, entity: entity, base: this.base().entities[id]}}); + } + return entity; }, transient: function(entity, key, fn) { diff --git a/js/id/id.js b/js/id/id.js index a72d602e8..e3b962ef3 100644 --- a/js/id/id.js +++ b/js/id/id.js @@ -78,7 +78,7 @@ window.iD = function () { }; context.geometry = function(id) { - return context.entity(id).geometry(history.graph()); + return context.entity(id, true).geometry(history.graph()); }; /* Modes */