diff --git a/packages/zapp/console/src/components/Launch/LaunchForm/UnionInput.tsx b/packages/zapp/console/src/components/Launch/LaunchForm/UnionInput.tsx index 27ca281df..edbe21d54 100644 --- a/packages/zapp/console/src/components/Launch/LaunchForm/UnionInput.tsx +++ b/packages/zapp/console/src/components/Launch/LaunchForm/UnionInput.tsx @@ -63,7 +63,7 @@ export const UnionInput = (props: InputProps) => { const listOfSubTypes = typeDefinition?.listOfSubTypes; - if (!listOfSubTypes) { + if (!listOfSubTypes?.length) { return <>; } diff --git a/packages/zapp/console/src/components/Launch/LaunchForm/inputHelpers/union.ts b/packages/zapp/console/src/components/Launch/LaunchForm/inputHelpers/union.ts index 6ceb44153..a8e485a78 100644 --- a/packages/zapp/console/src/components/Launch/LaunchForm/inputHelpers/union.ts +++ b/packages/zapp/console/src/components/Launch/LaunchForm/inputHelpers/union.ts @@ -20,7 +20,10 @@ function fromLiteral(literal: Core.ILiteral, inputTypeDefinition: InputTypeDefin ); return { value, typeDefinition: listOfSubTypes[i] } as UnionValue; } catch (error) { - // do nothing here it's expected to have error + // do nothing here. it's expected to have error from fromLiteral + // because we loop through all the type to decode the input value + // the error should be something like this + // new Error(`Failed to extract literal value with path ${path}`); } } throw new Error(t('noMatchingResults'));