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
2 changed files with 3 additions and 2 deletions

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) {