Fixed very minor race condition

This commit is contained in:
Jacob Stewart
2023-09-14 18:58:09 -04:00
parent bc640ee1b1
commit 636732e55f

View File

@@ -172,10 +172,11 @@ func Dial(address string, tlsConfig *tls.Config, ordered bool) (*Conn, error) {
printDataChannel(dataChannel)
trace("Dial: Data Channel OnOpen")
conn.raw, err = dataChannel.Detach()
detached, err := dataChannel.Detach()
if err != nil {
conn.pushErrorData(err)
} else {
conn.raw = detached
conn.dataChannel = dataChannel
connFinish <- true
}