From efb95b46f773da089640c3e31eac150beaa705e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Monnom?= Date: Sat, 31 Oct 2026 00:41:50 -0700 Subject: [PATCH] Fix nil source panic when broadcasting unlabeled data messages --- pkg/rtc/room.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/rtc/room.go b/pkg/rtc/room.go index a67adf754..743b09702 100644 --- a/pkg/rtc/room.go +++ b/pkg/rtc/room.go @@ -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) }) }