Skip to content

Commit

Permalink
Bugfix/Check condition when input is undefined (#2914)
Browse files Browse the repository at this point in the history
fix check condition when input is undefined
  • Loading branch information
HenryHengZJ committed Jul 30, 2024
1 parent c899c05 commit dd7e3ee
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/components/nodes/sequentialagents/commonUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit dd7e3ee

Please sign in to comment.