From 36a4ee7087deec9826129a493d8f828c284520d5 Mon Sep 17 00:00:00 2001 From: Jeromy Date: Sat, 8 Nov 2014 12:24:17 -0800 Subject: [PATCH] prevent NAT check if given nil multiaddr --- net/swarm/conn.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/net/swarm/conn.go b/net/swarm/conn.go index aa160b924d1..d215ea0e83d 100644 --- a/net/swarm/conn.go +++ b/net/swarm/conn.go @@ -119,7 +119,11 @@ func (s *Swarm) connSetup(c conn.Conn) (conn.Conn, error) { } // check for nats. you know, just in case. - s.checkNATWarning(h3result.LocalObservedAddress) + if h3result.LocalObservedAddress != nil { + s.checkNATWarning(h3result.LocalObservedAddress) + } else { + log.Warningf("Received nil observed address from %s", c.RemotePeer()) + } // add to conns s.connsLock.Lock()