mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-12 05:17:28 -08:00
fix(core): Throw error if required sub-node connection is missing (no-changelog) (#10123)
This commit is contained in:
parent
a8b5551331
commit
936cb57d79
|
@ -2755,6 +2755,12 @@ async function getInputConnectionData(
|
||||||
|
|
||||||
const parentNodes = workflow.getParentNodes(node.name, inputName, 1);
|
const parentNodes = workflow.getParentNodes(node.name, inputName, 1);
|
||||||
if (parentNodes.length === 0) {
|
if (parentNodes.length === 0) {
|
||||||
|
if (inputConfiguration.required) {
|
||||||
|
throw new NodeOperationError(
|
||||||
|
node,
|
||||||
|
`A ${inputConfiguration?.displayName ?? inputName} sub-node must be connected`,
|
||||||
|
);
|
||||||
|
}
|
||||||
return inputConfiguration.maxConnections === 1 ? undefined : [];
|
return inputConfiguration.maxConnections === 1 ? undefined : [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2888,7 +2894,10 @@ async function getInputConnectionData(
|
||||||
const nodes = await Promise.all(constParentNodes);
|
const nodes = await Promise.all(constParentNodes);
|
||||||
|
|
||||||
if (inputConfiguration.required && nodes.length === 0) {
|
if (inputConfiguration.required && nodes.length === 0) {
|
||||||
throw new NodeOperationError(node, `A ${inputName} processor node must be connected`);
|
throw new NodeOperationError(
|
||||||
|
node,
|
||||||
|
`A ${inputConfiguration?.displayName ?? inputName} sub-node must be connected`,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
inputConfiguration.maxConnections !== undefined &&
|
inputConfiguration.maxConnections !== undefined &&
|
||||||
|
@ -2896,7 +2905,7 @@ async function getInputConnectionData(
|
||||||
) {
|
) {
|
||||||
throw new NodeOperationError(
|
throw new NodeOperationError(
|
||||||
node,
|
node,
|
||||||
`Only ${inputConfiguration.maxConnections} ${inputName} processor nodes are/is allowed to be connected`,
|
`Only ${inputConfiguration.maxConnections} ${inputName} sub-nodes are/is allowed to be connected`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue