Skip to content

Commit 5034ca3

Browse files
committed
Fix race and return
1 parent 7327507 commit 5034ca3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

peer/conn.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,9 @@ func (c *Conn) init() error {
147147
// after the connection has been closed.
148148
c.closeMutex.Lock()
149149
defer c.closeMutex.Unlock()
150+
if c.isClosed() {
151+
return
152+
}
150153

151154
c.opts.Logger.Debug(context.Background(), "rtc connection updated",
152155
slog.F("state", pcs),

0 commit comments

Comments
 (0)