Fixed an entity not found error when restoring new ways that reference unloaded nodes (closed #4108, closed #5194)

This commit is contained in:
Quincy Morgan
2019-01-22 12:56:37 -05:00
parent 8cc3e14bae
commit 0499a76443
+8
View File
@@ -417,6 +417,14 @@ export function coreHistory(context) {
if (id in base.graph.entities) {
baseEntities[id] = base.graph.entities[id];
}
if (entity && entity.nodes) {
// get originals of pre-existing child nodes
_forEach(entity.nodes, function(nodeId) {
if (nodeId in base.graph.entities) {
baseEntities[nodeId] = base.graph.entities[nodeId];
}
});
}
// get originals of parent entities too
_forEach(base.graph._parentWays[id], function(parentId) {
if (parentId in base.graph.entities) {