@cryptotaxi247 / kubo / commits / 36a4ee708

prevent NAT check if given nil multiaddr

Jeromy committed Nov 8, 2014 at 12:24 UTC 36a4ee7087deec9826129a493d8f828c284520d5
1 file changed +5 -1
net/swarm/conn.go
+5 -1
@@ -119,7 +119,11 @@ func (s *Swarm) connSetup(c conn.Conn) (conn.Conn, error) {
119 }
120
121 // check for nats. you know, just in case.
122 - s.checkNATWarning(h3result.LocalObservedAddress)
122 + if h3result.LocalObservedAddress != nil {
123 + s.checkNATWarning(h3result.LocalObservedAddress)
124 + } else {
125 + log.Warningf("Received nil observed address from %s", c.RemotePeer())
126 + }
127
128 // add to conns
129 s.connsLock.Lock()