connmgr: Fix the ConnReq print out causing panic

This commit is contained in:
harzo 2018-07-11 13:26:24 +02:00 committed by Dave Collins
parent eec4f96b0d
commit ddd66de604

View File

@ -82,7 +82,7 @@ func (c *ConnReq) State() ConnState {
// String returns a human-readable string for the connection request.
func (c *ConnReq) String() string {
if c.Addr.String() == "" {
if c.Addr == nil || c.Addr.String() == "" {
return fmt.Sprintf("reqid %d", atomic.LoadUint64(&c.id))
}
return fmt.Sprintf("%s (reqid %d)", c.Addr, atomic.LoadUint64(&c.id))