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

Handle undefined node properties when mapping array references

This commit is contained in:
Nick O'Leary 2016-06-20 09:38:16 +01:00
parent 0eba04aac0
commit e29a0df3fd

View File

@ -903,7 +903,7 @@ RED.nodes = (function() {
if (configNode && configNode.users.indexOf(n) === -1) { if (configNode && configNode.users.indexOf(n) === -1) {
configNode.users.push(n); configNode.users.push(n);
} }
} else if (nodeTypeArrayReferences.hasOwnProperty(n.type) && nodeTypeArrayReferences[n.type] === d3 && n[d3] !== null) { } else if (nodeTypeArrayReferences.hasOwnProperty(n.type) && nodeTypeArrayReferences[n.type] === d3 && n[d3] !== undefined && n[d3] !== null) {
for (var j = 0;j<n[d3].length;j++) { for (var j = 0;j<n[d3].length;j++) {
if (node_map[n[d3][j]]) { if (node_map[n[d3][j]]) {
n[d3][j] = node_map[n[d3][j]].id; n[d3][j] = node_map[n[d3][j]].id;