From a011d995da758fd6016932a9a3c9bbacfa62bee4 Mon Sep 17 00:00:00 2001 From: Raja Subramanian Date: Thu, 18 Jun 2026 23:24:33 +0530 Subject: [PATCH] Do not call nil callback (#4607) --- pkg/rtc/participant.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/rtc/participant.go b/pkg/rtc/participant.go index 1034c2275..e65733d28 100644 --- a/pkg/rtc/participant.go +++ b/pkg/rtc/participant.go @@ -966,7 +966,9 @@ func (p *ParticipantImpl) GetTelemetryListener() types.ParticipantTelemetryListe func (p *ParticipantImpl) AddOnClose(key string, callback func(types.LocalParticipant)) { if p.isClosed.Load() { - go callback(p) + if callback != nil { + go callback(p) + } return }