Check Sender.track assigning for nil

It does not make sense to have Sender.track == nil
This commit is contained in:
mxmCherry
2019-03-05 22:44:44 +02:00
committed by mxmCherry
parent abd6448925
commit 3bc9a312bb

View File

@@ -1,6 +1,8 @@
package webrtc
import (
"fmt"
"github.com/pkg/errors"
)
@@ -17,6 +19,10 @@ type RTPTransceiver struct {
}
func (t *RTPTransceiver) setSendingTrack(track *Track) error {
if track == nil {
return fmt.Errorf("Track must not be nil")
}
t.Sender.track = track
switch t.Direction {