From 372e17ca08da053a1a8dd921e2824bc8a5d498e8 Mon Sep 17 00:00:00 2001 From: Anton Georgiev Date: Tue, 14 Mar 2023 16:39:06 -0400 Subject: [PATCH] fix: check if defined before checking .role --- bigbluebutton-html5/imports/ui/components/audio/service.js | 2 +- .../imports/ui/components/video-provider/service.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bigbluebutton-html5/imports/ui/components/audio/service.js b/bigbluebutton-html5/imports/ui/components/audio/service.js index 4e3fe44152..a3f72f2d8c 100755 --- a/bigbluebutton-html5/imports/ui/components/audio/service.js +++ b/bigbluebutton-html5/imports/ui/components/audio/service.js @@ -140,7 +140,7 @@ export default { isEchoTest: () => AudioManager.isEchoTest, error: () => AudioManager.error, isUserModerator: () => Users.findOne({ userId: Auth.userID }, - { fields: { role: 1 } }).role === ROLE_MODERATOR, + { fields: { role: 1 } })?.role === ROLE_MODERATOR, isVoiceUser, autoplayBlocked: () => AudioManager.autoplayBlocked, handleAllowAutoplay: () => AudioManager.handleAllowAutoplay(), diff --git a/bigbluebutton-html5/imports/ui/components/video-provider/service.js b/bigbluebutton-html5/imports/ui/components/video-provider/service.js index 2996a3dca7..ab49a2d844 100755 --- a/bigbluebutton-html5/imports/ui/components/video-provider/service.js +++ b/bigbluebutton-html5/imports/ui/components/video-provider/service.js @@ -642,7 +642,7 @@ class VideoService { const currentUser = Users.findOne({ userId: Auth.userID }, { fields: { role: 1 } }); - const isModerator = currentUser.role === 'MODERATOR'; + const isModerator = currentUser?.role === 'MODERATOR'; const isBreakout = meetingIsBreakout(); const isPinEnabled = this.isPinEnabled();