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.
This commit is contained in:
Bryan Housel
2015-12-22 23:33:27 -05:00
parent afca7c5643
commit 3830396e0f
+8 -2
View File
@@ -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)));