1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Ensure node/group xrefs are consistent on import

This commit is contained in:
Nick O'Leary 2020-07-10 15:59:28 +01:00
parent 97b7479081
commit 979c5351a8
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9

View File

@ -1442,7 +1442,15 @@ RED.nodes = (function() {
return node_map[id]; return node_map[id];
}) })
// Just in case the group references a node that doesn't exist for some reason // Just in case the group references a node that doesn't exist for some reason
n.nodes = n.nodes.filter(function(v) { return !!v}); n.nodes = n.nodes.filter(function(v) {
if (v) {
// Repair any nodes that have forgotten they are in this group
if (v.g !== n.id) {
v.g = n.id;
}
}
return !!v
});
if (!n.g) { if (!n.g) {
groupDepthMap[n.id] = 0; groupDepthMap[n.id] = 0;
} }