Skip to content

Commit 587c1c2

Browse files
committed
fix empty array case
1 parent f824bd4 commit 587c1c2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

apps/sim/blocks/blocks/a2a.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,8 @@ export const A2ABlock: BlockConfig<A2AResponse> = {
216216
tool: (params) => params.operation as string,
217217
params: (params) => {
218218
const { fileUpload, fileReference, ...rest } = params
219-
const files = fileUpload || fileReference
219+
const hasFileUpload = Array.isArray(fileUpload) ? fileUpload.length > 0 : !!fileUpload
220+
const files = hasFileUpload ? fileUpload : fileReference
220221
return {
221222
...rest,
222223
...(files ? { files } : {}),

0 commit comments

Comments
 (0)