Skip to content

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

sperakerstats: prevent access of nil object (#5112)

Saúl Ibarra Corretgé073fdc7b0e61
diff --git a/resources/prosody-plugins/mod_speakerstats_component.lua b/resources/prosody-plugins/mod_speakerstats_component.lua
index f325008021..7f30f6cc4d 100644
--- a/resources/prosody-plugins/mod_speakerstats_component.lua
+++ b/resources/prosody-plugins/mod_speakerstats_component.lua
@@ -53,7 +53,10 @@ function on_message(event)
local oldDominantSpeakerId = roomSpeakerStats['dominantSpeakerId'];
if oldDominantSpeakerId then
- roomSpeakerStats[oldDominantSpeakerId]:setDominantSpeaker(false);
+ local oldDominantSpeaker = roomSpeakerStats[oldDominantSpeakerId];
+ if oldDominantSpeaker then
+ oldDominantSpeaker:setDominantSpeaker(false);
+ end
end
if newDominantSpeaker then