🐛 Fix issue with IF&Switch node for undefined expressions #1099

This commit is contained in:
Jan Oberhauser
2020-10-26 09:26:07 +01:00
parent 5eb4a7c187
commit 66bfcca63f
9 changed files with 26 additions and 26 deletions

View File

@@ -205,7 +205,7 @@ export class Expression {
}
return returnData as NodeParameterValue[] | INodeParameters[];
} else if (parameterValue === null) {
} else if (parameterValue === null || parameterValue === undefined) {
return parameterValue;
} else {
// Data is an object

View File

@@ -383,7 +383,7 @@ export interface INodeExecuteFunctions {
// The values a node property can have
export type NodeParameterValue = string | number | boolean;
export type NodeParameterValue = string | number | boolean | undefined | null;
export interface INodeParameters {
// TODO: Later also has to be possible to add multiple ones with the name name. So array has to be possible

View File

@@ -642,7 +642,7 @@ export function getNodeParameters(nodePropertiesArray: INodeProperties[], nodeVa
}
// Itterate over all collections
for (const itemName of Object.keys(propertyValues)) {
for (const itemName of Object.keys(propertyValues || {})) {
if (nodeProperties.typeOptions !== undefined && nodeProperties.typeOptions.multipleValues === true) {
// Multiple can be set so will be an array

View File

@@ -380,8 +380,8 @@ export class Workflow {
const returnData: any = {}; // tslint:disable-line:no-any
for (const parameterName of Object.keys(parameterValue)) {
returnData[parameterName] = this.renameNodeInExpressions(parameterValue[parameterName], currentName, newName);
for (const parameterName of Object.keys(parameterValue || {})) {
returnData[parameterName] = this.renameNodeInExpressions(parameterValue![parameterName], currentName, newName);
}
return returnData;