From 2e18f8be94aa96c73e262448f46efebb3bc29eb5 Mon Sep 17 00:00:00 2001 From: Thomas Zemp Date: Thu, 14 Sep 2023 13:07:50 +0200 Subject: [PATCH] fix: handle empty user roles response (#1245) --- src/components/UserForm/RolesSection.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/UserForm/RolesSection.js b/src/components/UserForm/RolesSection.js index 39cba5897..1042564db 100644 --- a/src/components/UserForm/RolesSection.js +++ b/src/components/UserForm/RolesSection.js @@ -19,7 +19,7 @@ const RolesSection = React.memo( rightHeader={i18n.t('User roles this user is assigned')} options={userRoleOptions} initialValue={ - user?.userCredentials.userRoles.map(({ id }) => id) || [] + user?.userCredentials?.userRoles?.map(({ id }) => id) || [] } validate={hasSelectionValidator} />