Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

fix(features/notifications): crash on undefined participant

paweldomas14855f3255b9
diff --git a/react/features/notifications/middleware.js b/react/features/notifications/middleware.js
index 02f3b876c7..d30e1e1a82 100644
--- a/react/features/notifications/middleware.js
+++ b/react/features/notifications/middleware.js
@@ -84,9 +84,10 @@ MiddlewareRegistry.register(store => next => action => {
const { id, role } = action.participant;
const state = store.getState();
- const { role: oldRole } = getParticipantById(state, id);
+ const oldParticipant = getParticipantById(state, id);
+ const oldRole = oldParticipant?.role;
- if (oldRole !== role && role === PARTICIPANT_ROLE.MODERATOR) {
+ if (oldRole && oldRole !== role && role === PARTICIPANT_ROLE.MODERATOR) {
const displayName = getParticipantDisplayName(state, id);
store.dispatch(showNotification({