mirror of
https://github.com/pion/webrtc.git
synced 2025-12-24 11:51:03 +08:00
Check Sender.track assigning for nil
It does not make sense to have Sender.track == nil
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user