diff --git a/packages/javascript/bh-shared-ui/src/components/CreateUserForm/CreateUserForm.tsx b/packages/javascript/bh-shared-ui/src/components/CreateUserForm/CreateUserForm.tsx index 9a8ac0082..fec60be0b 100644 --- a/packages/javascript/bh-shared-ui/src/components/CreateUserForm/CreateUserForm.tsx +++ b/packages/javascript/bh-shared-ui/src/components/CreateUserForm/CreateUserForm.tsx @@ -84,7 +84,7 @@ const CreateUserForm: React.FC<{ }; const checkError = (err): string => { - if (err.response.data.errors[0].message == 'principal name must be unique') { + if (err.response?.data?.errors[0]?.message == 'principal name must be unique') { return 'Principal name is already in use.'; } else { return 'An unexpected error occurred. Please try again.';