fix: Check if user is found before looking up role (#21490)
This commit is contained in:
parent
52795280e2
commit
fa7a92f5fc
@ -172,7 +172,7 @@ function notifications() {
|
|||||||
break;
|
break;
|
||||||
case 'NotifyRoleInMeeting': {
|
case 'NotifyRoleInMeeting': {
|
||||||
const user = Users.findOne({ userId, meetingId }, { fields: { role: 1, userId: 1 } });
|
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;
|
break;
|
||||||
}
|
}
|
||||||
default: Logger.warn(`wrong type: ${notification.type} userId: ${userId}`);
|
default: Logger.warn(`wrong type: ${notification.type} userId: ${userId}`);
|
||||||
|
Loading…
Reference in New Issue
Block a user