Skip to content

Commit af05283

Browse files
committed
fix: guard the second registry lookup in tool-input
`selectedTools` validates only `value[0]?.type` and then casts the whole array, so a persisted workflow whose later rows lost their `type` yields `undefined` here — the cast is what makes the compiler believe otherwise. `getBlock` normalizes with `type.replace`, so that throws during render.
1 parent d7da73d commit af05283

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tool-input

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tool-input/tool-input.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ export const ToolInput = memo(function ToolInput({
530530
// Uses canonical resolution so the active field (basic vs advanced) is respected.
531531
const toolCredentialId = useMemo(() => {
532532
for (const [toolIndex, tool] of selectedTools.entries()) {
533-
const blockConfig = getBlock(tool.type)
533+
const blockConfig = tool.type ? getBlock(tool.type) : undefined
534534
if (!blockConfig?.subBlocks) continue
535535
// canonical-index-unscoped: a nested tool resolves against `tool.params`, which only ever
536536
// holds action-surface values — a tool is never invoked in trigger mode.

0 commit comments

Comments
 (0)