sperakerstats: prevent access of nil object (#5112)

If the dominant speaker leaves their object will be gone from the mapping.
This commit is contained in:
Saúl Ibarra Corretgé
2020-03-06 12:33:41 +01:00
committed by GitHub
parent fedaa0ae6e
commit 073fdc7b0e
@@ -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