Skip to content

Commit afadcf5

Browse files
committed
fix(serializer): guard array results and drop redundant fallback in tool param validation
1 parent 984ef96 commit afadcf5

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

apps/sim/serializer/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ export class Serializer {
444444
const paramsMapper = blockConfig.tools?.config?.params
445445
if (typeof paramsMapper === 'function') {
446446
const result = paramsMapper({ ...params })
447-
if (result && typeof result === 'object') {
447+
if (result && typeof result === 'object' && !Array.isArray(result)) {
448448
mappedParams = { ...params, ...result }
449449
}
450450
}
@@ -485,7 +485,7 @@ export class Serializer {
485485
return
486486
}
487487

488-
const fieldValue = mappedParams[paramId] ?? params[paramId]
488+
const fieldValue = mappedParams[paramId]
489489
if (fieldValue === undefined || fieldValue === null || fieldValue === '') {
490490
const activeConfig = matchingConfigs.find((config: any) =>
491491
shouldSerializeSubBlock(

0 commit comments

Comments
 (0)