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

Handle importing only one end of a link node pair

This commit is contained in:
Nick O'Leary 2017-07-04 23:40:37 +01:00
parent a10439b67c
commit 266274135e
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
2 changed files with 3 additions and 3 deletions

View File

@ -482,7 +482,7 @@ RED.view = (function() {
try {
nn._def.onadd.call(nn);
} catch(err) {
console.log("onadd:",err);
console.log("Definition error: "+nn.type+".onadd:",err);
}
}
} else {
@ -2581,7 +2581,7 @@ RED.view = (function() {
try {
node.n._def.onadd.call(node.n);
} catch(err) {
console.log("onadd:",err);
console.log("Definition error: "+node.n.type+".onadd:",err);
}
}

View File

@ -251,7 +251,7 @@
function onAdd() {
for (var i=0;i<this.links.length;i++) {
var n = RED.nodes.node(this.links[i]);
if (n.links.indexOf(this.id) === -1) {
if (n && n.links.indexOf(this.id) === -1) {
n.links.push(this.id);
}
}