Skip to content

Commit

Permalink
fix: update the format
Browse files Browse the repository at this point in the history
Signed-off-by: eugenejahn <[email protected]>
  • Loading branch information
eugenejahn committed Jul 8, 2022
1 parent 934e921 commit 866e71b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const UnionInput = (props: InputProps) => {

const listOfSubTypes = typeDefinition?.listOfSubTypes;

if (!listOfSubTypes) {
if (!listOfSubTypes?.length) {
return <></>;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
Expand Down

0 comments on commit 866e71b

Please sign in to comment.