mirror of
https://github.com/netbirdio/netbird.git
synced 2025-01-23 22:38:36 +01:00
[client] Close ice agent only if not nil (#3210)
This commit is contained in:
parent
3e836db1d1
commit
9f4db0a953
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user