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:
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
|
||||
|
|
Loading…
Reference in New Issue