Fix receiver not found when best quality is received last
@@ -87,7 +87,9 @@ func (r *router) AddSender(p *WebRTCTransport) error {
ssrc = recv.Track().SSRC()
} else {
for _, rcv := range r.receivers {
+ if rcv != nil {
recv = rcv
+ }
if !r.config.Simulcast.BestQualityFirst && rcv != nil {
break
}
