mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
fix(Merge Node): Do not error if expected key is missing
This commit is contained in:
@@ -35,7 +35,7 @@ const versionDescription: INodeTypeDescription = {
|
||||
name: 'merge',
|
||||
icon: 'fa:code-branch',
|
||||
group: ['transform'],
|
||||
version: 2,
|
||||
version: [2, 2.1],
|
||||
subtitle: '={{$parameter["mode"]}}',
|
||||
description: 'Merges data of multiple streams once data from both is available',
|
||||
defaults: {
|
||||
@@ -450,20 +450,28 @@ export class MergeV2 implements INodeType {
|
||||
options.joinMode = joinMode;
|
||||
options.outputDataFrom = outputDataFrom;
|
||||
|
||||
const input1 = checkInput(
|
||||
this.getInputData(0),
|
||||
matchFields.map((pair) => pair.field1),
|
||||
options.disableDotNotation || false,
|
||||
'Input 1',
|
||||
);
|
||||
if (!input1) return [returnData];
|
||||
const nodeVersion = this.getNode().typeVersion;
|
||||
|
||||
const input2 = checkInput(
|
||||
this.getInputData(1),
|
||||
matchFields.map((pair) => pair.field2),
|
||||
options.disableDotNotation || false,
|
||||
'Input 2',
|
||||
);
|
||||
let input1 = this.getInputData(0);
|
||||
let input2 = this.getInputData(1);
|
||||
if (nodeVersion < 2.1) {
|
||||
input1 = checkInput(
|
||||
this.getInputData(0),
|
||||
matchFields.map((pair) => pair.field1),
|
||||
options.disableDotNotation || false,
|
||||
'Input 1',
|
||||
);
|
||||
if (!input1) return [returnData];
|
||||
|
||||
input2 = checkInput(
|
||||
this.getInputData(1),
|
||||
matchFields.map((pair) => pair.field2),
|
||||
options.disableDotNotation || false,
|
||||
'Input 2',
|
||||
);
|
||||
} else {
|
||||
if (!input1) return [returnData];
|
||||
}
|
||||
|
||||
if (!input2 || !matchFields.length) {
|
||||
if (
|
||||
|
||||
Reference in New Issue
Block a user