From a600dfc9e313f4cd13c6dae8e4f32a8dca1b2a75 Mon Sep 17 00:00:00 2001 From: Raja Subramanian Date: Sun, 21 Aug 2022 22:36:59 +0530 Subject: [PATCH] Log and return error on no response sink. (#937) * Log and return error on no response sink. * Clean up --- pkg/rtc/participant_signal.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/rtc/participant_signal.go b/pkg/rtc/participant_signal.go index afe30bedc..6bf632238 100644 --- a/pkg/rtc/participant_signal.go +++ b/pkg/rtc/participant_signal.go @@ -174,10 +174,15 @@ func (p *ParticipantImpl) writeMessage(msg *livekit.SignalResponse) error { if p.State() == livekit.ParticipantInfo_DISCONNECTED { return nil } + sink := p.getResponseSink() if sink == nil { - return nil + err := fmt.Errorf("no response sink") + p.params.Logger.Warnw("could not send message to participant", err, + "message", fmt.Sprintf("%T", msg.Message)) + return err } + err := sink.WriteMessage(msg) if err != nil { p.params.Logger.Warnw("could not send message to participant", err,