connmanager: check Addr for nil

This commit is contained in:
Johan T. Halseth 2018-10-01 13:55:43 +02:00
parent 2a560b2036
commit 4b5ff8c687
No known key found for this signature in database
GPG key ID: 15BAADA29DA20D26

View file

@ -89,7 +89,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))