From 17bba4d4a28644fb99bdffc5e6bef62d690ea3fd Mon Sep 17 00:00:00 2001 From: seydx Date: Fri, 24 Jan 2025 12:47:25 +0100 Subject: [PATCH] skip empty ICE candidates --- pkg/ring/client.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkg/ring/client.go b/pkg/ring/client.go index db8e2eaa..47790664 100644 --- a/pkg/ring/client.go +++ b/pkg/ring/client.go @@ -238,6 +238,11 @@ func Dial(rawURL string) (*Client, error) { iceCandidate := msg.ToJSON() + // skip empty ICE candidates + if iceCandidate.Candidate == "" { + return + } + icePayload := map[string]interface{}{ "ice": iceCandidate.Candidate, "mlineindex": iceCandidate.SDPMLineIndex, @@ -425,6 +430,12 @@ func Dial(rawURL string) (*Client, error) { return } + // check for empty ICE candidate + if msg.Body.Ice == "" { + println("Received empty ICE candidate") + continue + } + if err = prod.AddCandidate(msg.Body.Ice); err != nil { client.Stop() return