diff --git a/AUTHORS.txt b/AUTHORS.txt index d6ff714..b41ff51 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -8,6 +8,7 @@ Adam Kiss adwpc Aleksandr Razumov Antoine Baché +Artur Shellunts Assad Obaid Atsushi Watanabe backkem diff --git a/agent.go b/agent.go index 0d966af..70d4908 100644 --- a/agent.go +++ b/agent.go @@ -588,14 +588,12 @@ func (a *Agent) setSelectedPair(p *CandidatePair) { a.updateConnectionState(ConnectionStateConnected) // Notify when the selected pair changes - if p != nil { - a.afterRun(func(ctx context.Context) { - select { - case a.chanCandidatePair <- p: - case <-ctx.Done(): - } - }) - } + a.afterRun(func(ctx context.Context) { + select { + case a.chanCandidatePair <- p: + case <-ctx.Done(): + } + }) // Signal connected a.onConnectedOnce.Do(func() { close(a.onConnected) })