diff --git a/react/features/notifications/middleware.js b/react/features/notifications/middleware.js index 02f3b876c..d30e1e1a8 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({