Merge pull request #17044 from antobinary/fix-undefined-user

fix: Fix undefined user in rare end-breakout scenario
This commit is contained in:
Ramón Souza 2023-03-17 14:06:15 -03:00 committed by GitHub
commit c3d89ee4fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -140,7 +140,7 @@ export default {
isEchoTest: () => AudioManager.isEchoTest, isEchoTest: () => AudioManager.isEchoTest,
error: () => AudioManager.error, error: () => AudioManager.error,
isUserModerator: () => Users.findOne({ userId: Auth.userID }, isUserModerator: () => Users.findOne({ userId: Auth.userID },
{ fields: { role: 1 } }).role === ROLE_MODERATOR, { fields: { role: 1 } })?.role === ROLE_MODERATOR,
isVoiceUser, isVoiceUser,
autoplayBlocked: () => AudioManager.autoplayBlocked, autoplayBlocked: () => AudioManager.autoplayBlocked,
handleAllowAutoplay: () => AudioManager.handleAllowAutoplay(), handleAllowAutoplay: () => AudioManager.handleAllowAutoplay(),

View File

@ -642,7 +642,7 @@ class VideoService {
const currentUser = Users.findOne({ userId: Auth.userID }, const currentUser = Users.findOne({ userId: Auth.userID },
{ fields: { role: 1 } }); { fields: { role: 1 } });
const isModerator = currentUser.role === 'MODERATOR'; const isModerator = currentUser?.role === 'MODERATOR';
const isBreakout = meetingIsBreakout(); const isBreakout = meetingIsBreakout();
const isPinEnabled = this.isPinEnabled(); const isPinEnabled = this.isPinEnabled();