Allow group.API() to fail.

This commit is contained in:
Juliusz Chroboczek
2021-04-29 20:38:06 +02:00
parent acca3f9bb3
commit cd6920d7e2
2 changed files with 20 additions and 9 deletions
+9 -2
View File
@@ -157,7 +157,10 @@ func (down *rtpDownConnection) getTracks() []*rtpDownTrack {
}
func newDownConn(c group.Client, id string, remote conn.Up) (*rtpDownConnection, error) {
api := c.Group().API()
api, err := c.Group().API()
if err != nil {
return nil, err
}
pc, err := api.NewPeerConnection(*ice.ICEConfiguration())
if err != nil {
return nil, err
@@ -463,7 +466,11 @@ func newUpConn(c group.Client, id string, label string, offer string) (*rtpUpCon
return nil, err
}
pc, err := c.Group().API().NewPeerConnection(*ice.ICEConfiguration())
api, err := c.Group().API()
if err != nil {
return nil, err
}
pc, err := api.NewPeerConnection(*ice.ICEConfiguration())
if err != nil {
return nil, err
}