[client] Close ice agent only if not nil (#3210)

This commit is contained in:
Maycon Santos 2025-01-18 00:18:59 +01:00 committed by GitHub
parent 3e836db1d1
commit 9f4db0a953
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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)
}