Skip to content

Commit

Permalink
Fixed pion#197
Browse files Browse the repository at this point in the history
Added a check in case p has no value. I just returned the string "nil" if there is no value (e.g. connection loss).
  • Loading branch information
wawesomeNOGUI committed Jan 15, 2021
1 parent 9ba22cf commit 4d5464a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion candidatepair.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,12 @@ type candidatePair struct {
}

func (p *candidatePair) String() string {
return fmt.Sprintf("prio %d (local, prio %d) %s <-> %s (remote, prio %d)",
if p != nil {
return fmt.Sprintf("prio %d (local, prio %d) %s <-> %s (remote, prio %d)",
p.Priority(), p.local.Priority(), p.local, p.remote, p.remote.Priority())
}else{
return "nil"
}
}

func (p *candidatePair) Equal(other *candidatePair) bool {
Expand Down

0 comments on commit 4d5464a

Please sign in to comment.