Skip to content

Commit

Permalink
[client] Close ice agent only if not nil (#3210)
Browse files Browse the repository at this point in the history
  • Loading branch information
mlsmaycon authored Jan 17, 2025
1 parent 3e836db commit 9f4db0a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions client/internal/peer/worker_ice.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,10 @@ func (w *WorkerICE) closeAgent(cancel context.CancelFunc) {
defer w.muxAgent.Unlock()

cancel()
if w.agent == nil {
return
}

if err := w.agent.Close(); err != nil {
w.log.Warnf("failed to close ICE agent: %s", err)
}
Expand Down

0 comments on commit 9f4db0a

Please sign in to comment.