From 583164b0415c0375fd78050fea7fc7c3871916a4 Mon Sep 17 00:00:00 2001 From: Thomas Zemp Date: Thu, 14 Sep 2023 13:07:32 +0200 Subject: [PATCH] fix: handle empty user roles response (#1246) --- 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 f4d99291f..d906d80a2 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} />