Commit 72cfb96e authored by David Fifield's avatar David Fifield
Browse files

Restore check for nil writePipe in WebRTCPeer.Close.

I removed this check in 047d3214 because
NewWebRTCPeer always initializes writePipe, and it is never reset to
nil. However tests used &WebRTCPeer{} which bypasses NewWebRTCPeer and
leaves writePipe set to nil.
parent 5e8f9ac5
......@@ -236,7 +236,9 @@ func exchangeSDP(broker *BrokerChannel, offer *webrtc.SessionDescription) *webrt
// Close all channels and transports
func (c *WebRTCPeer) cleanup() {
// Close this side of the SOCKS pipe.
if c.writePipe != nil { // c.writePipe can be nil in tests.
if nil != c.transport {
log.Printf("WebRTC: closing DataChannel")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment