Merge pull request #20013 from prlanzarin/u27/fix/arthurk12-undefined-role-crash

[2.7] fix: add safeguards when returning user roles
This commit is contained in:
Anton Georgiev 2024-04-12 15:53:42 -04:00 committed by GitHub
commit 85b5e83bd5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -11,7 +11,7 @@ const getUserRoles = () => {
userId: Auth.userID, userId: Auth.userID,
}); });
return user.role; return user?.role;
}; };
const isPresenter = () => { const isPresenter = () => {
@ -19,7 +19,7 @@ const isPresenter = () => {
userId: Auth.userID, userId: Auth.userID,
}); });
return user.presenter; return user?.presenter;
}; };
const showGuestNotification = () => { const showGuestNotification = () => {