diff --git a/client.go b/client.go index 588cc5d..e6fb59d 100644 --- a/client.go +++ b/client.go @@ -1107,7 +1107,9 @@ func (c *Client) afterClosed() { c.state.Store(ClientStateEnded) - c.internalDataChannel.Close() + if c.internalDataChannel != nil { + c.internalDataChannel.Close() + } c.onLeft() diff --git a/testhelper.go b/testhelper.go index e55160c..986ec8f 100644 --- a/testhelper.go +++ b/testhelper.go @@ -541,8 +541,8 @@ func CreatePeerPair(ctx context.Context, log logging.LeveledLogger, room *Room, currentTranscv := len(pc.GetTransceivers()) - log.Infof("test: got renegotiation ", peerName) - defer log.Infof("test: renegotiation done ", peerName) + log.Infof("test: got renegotiation %s", peerName) + defer log.Infof("test: renegotiation done %s", peerName) if err = pc.SetRemoteDescription(offer); err != nil { return webrtc.SessionDescription{}, err } @@ -554,7 +554,7 @@ func CreatePeerPair(ctx context.Context, log logging.LeveledLogger, room *Room, } newTcv := len(pc.GetTransceivers()) - currentTranscv - log.Infof("test: new transceiver ", newTcv, " total tscv ", len(pc.GetTransceivers())) + log.Infof("test: new transceiver %d total tscv %d", newTcv, len(pc.GetTransceivers())) peer.Mu.Lock() peer.IsInRenegotiation = false