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

Prevent wire from normal node to link virtual port

Fixes #2114
This commit is contained in:
Nick O'Leary 2019-03-28 10:48:48 +00:00
parent fe2360883f
commit dd89ea3731
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9

View File

@ -1903,10 +1903,18 @@ RED.view = (function() {
} }
} }
} else { } else {
var existingLink = RED.nodes.filterLinks({source:src,target:dst,sourcePort: src_port}).length !== 0; // This is not a virtualLink - which means it started
if (!existingLink) { // on a regular node port. Need to ensure the this isn't
RED.nodes.addLink(link); // connecting to a link node virual port.
addedLinks.push(link); if (!(
(d.type === "link out" && portType === PORT_TYPE_OUTPUT) ||
(d.type === "link in" && portType === PORT_TYPE_INPUT)
)) {
var existingLink = RED.nodes.filterLinks({source:src,target:dst,sourcePort: src_port}).length !== 0;
if (!existingLink) {
RED.nodes.addLink(link);
addedLinks.push(link);
}
} }
} }
} }