Skip to content

Commit

Permalink
Fix AddRemoteCandidate to accept nil candidate
Browse files Browse the repository at this point in the history
empty candidate.Candidate won't make an error when pass into pion/ice
  • Loading branch information
scorpionknifes committed Dec 7, 2020
1 parent 5e5f171 commit be75944
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,12 @@ func (a *Agent) checkKeepalive() {

// AddRemoteCandidate adds a new remote candidate
func (a *Agent) AddRemoteCandidate(c Candidate) error {
// canot check for network yet because it might not be applied
// accept nil candidate. aka end-of-candidates will not fail
if c == nil {
return nil
}

// cannot check for network yet because it might not be applied
// when mDNS hostame is used.
if c.TCPType() == TCPTypeActive {
// TCP Candidates with tcptype active will probe server passive ones, so
Expand Down

0 comments on commit be75944

Please sign in to comment.