Skip to content

Commit a53a84f

Browse files
author
Georgi2704
committed
Fix bug when we don't handle case in translate label function when we pass an object to it
1 parent b84354c commit a53a84f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

frontend/packages/pydantic-forms/src/core/hooks/usePydanticFormParser.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ const translateLabel = (
3333
label?: string,
3434
formLabels?: Record<string, string>,
3535
): string | undefined => {
36-
return formLabels && formLabels[propertyId]
36+
const isString = typeof formLabels?.[propertyId] === 'string'
37+
return formLabels && formLabels[propertyId] && isString
3738
? formLabels[propertyId].toString()
3839
: label;
3940
};

0 commit comments

Comments
 (0)