diff --git a/js/id/actions/delete_way.js b/js/id/actions/delete_way.js index 86fe3a3bc..a16309e56 100644 --- a/js/id/actions/delete_way.js +++ b/js/id/actions/delete_way.js @@ -11,6 +11,10 @@ iD.actions.DeleteWay = function(wayId) { way.nodes.forEach(function (nodeId) { var node = graph.entity(nodeId); + // Circular ways include nodes more than once, so they + // can be deleted on earlier iterations of this loop. + if (!node) return; + graph = iD.actions.RemoveWayNode(wayId, nodeId)(graph); if (!graph.parentWays(nodeId).length && !graph.parentRelations(nodeId).length) {