From dd7e3eef040534f1f20ffff1c2e79e06950fd174 Mon Sep 17 00:00:00 2001 From: Henry Heng Date: Tue, 30 Jul 2024 23:20:36 +0100 Subject: [PATCH] Bugfix/Check condition when input is undefined (#2914) fix check condition when input is undefined --- packages/components/nodes/sequentialagents/commonUtils.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/components/nodes/sequentialagents/commonUtils.ts b/packages/components/nodes/sequentialagents/commonUtils.ts index 431b34d0..b68de0bc 100644 --- a/packages/components/nodes/sequentialagents/commonUtils.ts +++ b/packages/components/nodes/sequentialagents/commonUtils.ts @@ -13,7 +13,8 @@ import { ICommonObject, IDatabaseEntity, INodeData, ISeqAgentsState, IVisionChat import { availableDependencies, defaultAllowBuiltInDep, getVars, prepareSandboxVars } from '../../src/utils' export const checkCondition = (input: string | number | undefined, condition: string, value: string | number = ''): boolean => { - if (!input) return false + if (!input && condition === 'Is Empty') return true + else if (!input) return false // Function to check if a string is a valid number const isNumericString = (str: string): boolean => /^-?\d*\.?\d+$/.test(str)