From c71c64798a540713fd0a7761ba83079efe4e0d2d Mon Sep 17 00:00:00 2001 From: Thomas Tignor Date: Thu, 4 Jan 2024 13:43:12 -0500 Subject: [PATCH] Fixed Profile primaryRole bug --- tdrs-frontend/src/components/Profile/Profile.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tdrs-frontend/src/components/Profile/Profile.jsx b/tdrs-frontend/src/components/Profile/Profile.jsx index 232fc3470..5ae65cdeb 100644 --- a/tdrs-frontend/src/components/Profile/Profile.jsx +++ b/tdrs-frontend/src/components/Profile/Profile.jsx @@ -12,7 +12,7 @@ import { function Profile() { const user = useSelector((state) => state.auth.user) // Most higher-env users will only have a single role, so just grab the first one. - const primaryRole = user?.roles[0] + const primaryRole = user?.roles?.[0] const missingAccessRequest = useSelector(accountIsMissingAccessRequest) const isAccessRequestPending = useSelector(accountIsInReview)