From 3830396e0fae884551e45e732a1b4b95368eb04b Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Tue, 22 Dec 2015 23:33:27 -0500 Subject: [PATCH] Ignore entity not found errors in childNodes conflict check (closes #2736) Entity not found is caused by subtle bugs elsewhere in the iD code and should not prevent users from saving their work because it can't be thoroughly conflict checked. --- js/id/modes/save.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/js/id/modes/save.js b/js/id/modes/save.js index 1bf4e09e0..f3077cf12 100644 --- a/js/id/modes/save.js +++ b/js/id/modes/save.js @@ -12,8 +12,14 @@ iD.modes.Save = function(context) { return _.uniq(_.reduce(ids, function(result, id) { var e = graph.entity(id); if (e.type === 'way') { - var cn = graph.childNodes(e); - result.push.apply(result, _.pluck(_.filter(cn, 'version'), 'id')); + try { + var cn = graph.childNodes(e); + result.push.apply(result, _.pluck(_.filter(cn, 'version'), 'id')); + } catch(err) { + /* eslint-disable no-console */ + if (typeof console !== 'undefined') console.error(err); + /* eslint-enable no-console */ + } } return result; }, _.clone(ids)));