fix(Merge Node): Do not error if expected key is missing

This commit is contained in:
Michael Kret
2023-04-28 19:46:59 +03:00
committed by GitHub
parent c0b1cddc91
commit d219af75cf
11 changed files with 1257 additions and 74 deletions

View File

@@ -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 (