From 0cdc2e9dc85b4912b2c08df8ce109940addfa468 Mon Sep 17 00:00:00 2001 From: Michael Kret <88898367+michael-radency@users.noreply.github.com> Date: Fri, 30 Sep 2022 18:19:33 +0300 Subject: [PATCH] fix(IF Node): bug when null isn't considerate empty in isEmpty and isNotEmpty comparison --- packages/nodes-base/nodes/If/If.node.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/nodes-base/nodes/If/If.node.ts b/packages/nodes-base/nodes/If/If.node.ts index 099482799f..0047186e72 100644 --- a/packages/nodes-base/nodes/If/If.node.ts +++ b/packages/nodes-base/nodes/If/If.node.ts @@ -346,13 +346,13 @@ export class If implements INodeType { notStartsWith: (value1: NodeParameterValue, value2: NodeParameterValue) => !(value1 as string).startsWith(value2 as string), isEmpty: (value1: NodeParameterValue) => - [undefined, null, ''].includes(value1 as string) || + [undefined, null, '', NaN].includes(value1 as string) || (typeof value1 === 'object' && value1 !== null ? Object.entries(value1 as string).length === 0 : false), isNotEmpty: (value1: NodeParameterValue) => !( - [undefined, null, ''].includes(value1 as string) || + [undefined, null, '', NaN].includes(value1 as string) || (typeof value1 === 'object' && value1 !== null ? Object.entries(value1 as string).length === 0 : false)