From 4d521b993acd016411af404368835b94e380fd69 Mon Sep 17 00:00:00 2001 From: Wes Date: Fri, 6 Dec 2024 12:42:47 -0500 Subject: [PATCH] BED-5065: Add null checks to error --- .../src/components/CreateUserForm/CreateUserForm.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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.';