mirror of
https://github.com/netbirdio/ice.git
synced 2026-05-22 17:10:58 -07:00
Remove redundant check for null pointer
Pointer is already checked earlier in the function
This commit is contained in:
committed by
Steffen Vogel
parent
3ed38e954a
commit
c3e0417858
@@ -8,6 +8,7 @@ Adam Kiss <masterada@gmail.com>
|
||||
adwpc <adwpc@hotmail.com>
|
||||
Aleksandr Razumov <ar@gortc.io>
|
||||
Antoine Baché <antoine@tenten.app>
|
||||
Artur Shellunts <shellunts.artur@gmail.com>
|
||||
Assad Obaid <assad@lap5cg901003r.se.axis.com>
|
||||
Atsushi Watanabe <atsushi.w@ieee.org>
|
||||
backkem <mail@backkem.me>
|
||||
|
||||
@@ -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) })
|
||||
|
||||
Reference in New Issue
Block a user