From 4d5464ad2c33e50356df9c7d3c351314d3abf29f Mon Sep 17 00:00:00 2001 From: Will Forcey Date: Fri, 15 Jan 2021 12:15:20 -0500 Subject: [PATCH] Fixed #197 Added a check in case p has no value. I just returned the string "nil" if there is no value (e.g. connection loss). --- candidatepair.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/candidatepair.go b/candidatepair.go index 00f904eb..3bf54dce 100644 --- a/candidatepair.go +++ b/candidatepair.go @@ -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 {