mirror of
https://github.com/livekit/livekit.git
synced 2026-11-23 00:19:05 +00:00
Fix nil source panic when broadcasting unlabeled data messages
This commit is contained in:
1 parent
09a0091e9d
commit
efb95b46f7
1 file changed
+5
-1
+5
-1
@@ -2180,12 +2180,16 @@ func BroadcastDataPacketForRoom(
|
||||
}
|
||||
|
||||
func BroadcastDataMessageForRoom(r types.Room, source types.LocalParticipant, data []byte, logger logger.Logger) {
|
||||
var sender livekit.ParticipantIdentity
|
||||
if source != nil {
|
||||
sender = source.Identity()
|
||||
}
|
||||
utils.ParallelExec(r.GetLocalParticipants(), dataForwardLoadBalanceThreshold, 1, func(op types.LocalParticipant) {
|
||||
if source != nil && op.ID() == source.ID() {
|
||||
return
|
||||
}
|
||||
|
||||
op.SendDataMessageUnlabeled(data, false, source.Identity())
|
||||
op.SendDataMessageUnlabeled(data, false, sender)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user