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

Prevent wiring to node with no corresponding port

Fixes #2641
This commit is contained in:
Nick O'Leary 2020-07-06 17:32:44 +01:00
parent ef7c9b5c2a
commit 6c04402a98
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
2 changed files with 3 additions and 2 deletions

View File

@ -1429,7 +1429,6 @@ RED.nodes = (function() {
}
// Order the groups to ensure they are outer-most to inner-most
var groupDepthMap = {};
console.log(new_groups);
for (i=0;i<new_groups.length;i++) {
n = new_groups[i];
if (n.g && node_map[n.g]) {

View File

@ -2416,7 +2416,9 @@ RED.view = (function() {
// connecting to a link node virual port.
if (!(
(d.type === "link out" && portType === PORT_TYPE_OUTPUT) ||
(d.type === "link in" && portType === PORT_TYPE_INPUT)
(d.type === "link in" && portType === PORT_TYPE_INPUT) ||
(portType === PORT_TYPE_OUTPUT && mouseup_node.outputs === 0) ||
(portType === PORT_TYPE_INPUT && mouseup_node.inputs === 0)
)) {
var existingLink = RED.nodes.filterLinks({source:src,target:dst,sourcePort: src_port}).length !== 0;
if (!existingLink) {