From 70462f7c6f4bde8f7b0ece2bb884abcd384e8b8e Mon Sep 17 00:00:00 2001 From: Djorkaeff Alexandre Date: Wed, 13 May 2020 16:04:50 -0300 Subject: [PATCH] [FIX] Roles throwing error (#2110) Co-authored-by: Diego Mello --- app/lib/rocketchat.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/lib/rocketchat.js b/app/lib/rocketchat.js index 036604072..ddf562cc1 100644 --- a/app/lib/rocketchat.js +++ b/app/lib/rocketchat.js @@ -316,7 +316,7 @@ const RocketChat = { } database.share = null; - reduxStore.dispatch(shareSetUser(null)); + reduxStore.dispatch(shareSetUser({})); }, updateJitsiTimeout(rid) { @@ -963,7 +963,7 @@ const RocketChat = { const shareUser = reduxStore.getState().share.user; const loginUser = reduxStore.getState().login.user; // get user roles on the server from redux - const userRoles = (shareUser.roles || loginUser.roles) || []; + const userRoles = (shareUser?.roles || loginUser?.roles) || []; // merge both roles const mergedRoles = [...new Set([...roomRoles, ...userRoles])];