diff --git a/pkg/publisher.go b/pkg/publisher.go index da81553f5..b266b3f47 100644 --- a/pkg/publisher.go +++ b/pkg/publisher.go @@ -84,8 +84,8 @@ func (p *Publisher) Answer(offer webrtc.SessionDescription) (webrtc.SessionDescr for _, c := range p.candidates { p.pc.AddICECandidate(c) - p.candidates = nil } + p.candidates = nil answer, err := p.pc.CreateAnswer(nil) if err != nil { diff --git a/pkg/subscriber.go b/pkg/subscriber.go index c02e8156c..047167a9f 100644 --- a/pkg/subscriber.go +++ b/pkg/subscriber.go @@ -208,8 +208,8 @@ func (s *Subscriber) SetRemoteDescription(desc webrtc.SessionDescription) error for _, c := range s.candidates { s.pc.AddICECandidate(c) - s.candidates = nil } + s.candidates = nil return nil }