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(stage-tile-view): crash when pinning

Hristo Terezov084f9116993e
diff --git a/react/features/filmstrip/middleware.web.js b/react/features/filmstrip/middleware.web.js
index 6d4f75cb97..d84254e8c9 100644
--- a/react/features/filmstrip/middleware.web.js
+++ b/react/features/filmstrip/middleware.web.js
@@ -171,13 +171,20 @@ MiddlewareRegistry.register(store => next => action => {
}
}
- dispatch(setStageParticipants(queue));
- if (!pinned) {
- const timeoutId = setTimeout(() => dispatch(removeStageParticipant(participantId)),
- ACTIVE_PARTICIPANT_TIMEOUT);
-
- timers.set(participantId, timeoutId);
+ // If queue is undefined we haven't made any changes to the active participants. This will mostly happen
+ // if the participant that we are trying to add is not pinned and all slots are currently taken by pinned
+ // participants.
+ // IMPORTANT: setting active participants to undefined will crash jitsi-meet.
+ if (typeof queue !== 'undefined') {
+ dispatch(setStageParticipants(queue));
+ if (!pinned) {
+ const timeoutId = setTimeout(() => dispatch(removeStageParticipant(participantId)),
+ ACTIVE_PARTICIPANT_TIMEOUT);
+
+ timers.set(participantId, timeoutId);
+ }
}
+
if (getCurrentLayout(state) === LAYOUTS.TILE_VIEW) {
dispatch(setTileView(false));
}