From fa7a92f5fc770f58c690f928dd542952d2577466 Mon Sep 17 00:00:00 2001 From: Anton Georgiev Date: Tue, 22 Oct 2024 10:18:49 -0400 Subject: [PATCH] fix: Check if user is found before looking up role (#21490) --- bigbluebutton-html5/imports/api/meetings/server/publishers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bigbluebutton-html5/imports/api/meetings/server/publishers.js b/bigbluebutton-html5/imports/api/meetings/server/publishers.js index ab7b8240f5..fc59a7e0d5 100755 --- a/bigbluebutton-html5/imports/api/meetings/server/publishers.js +++ b/bigbluebutton-html5/imports/api/meetings/server/publishers.js @@ -172,7 +172,7 @@ function notifications() { break; case 'NotifyRoleInMeeting': { const user = Users.findOne({ userId, meetingId }, { fields: { role: 1, userId: 1 } }); - if (notification.meetingId === meetingId && notification.role === user.role) this.added('notifications', Random.id(), notification); + if (user && notification.meetingId === meetingId && notification.role === user.role) this.added('notifications', Random.id(), notification); break; } default: Logger.warn(`wrong type: ${notification.type} userId: ${userId}`);