p2p/net/swarm/addr: check for nil addr

This commit is contained in:
Juan Batiz-Benet 2015-01-22 17:50:23 -08:00
parent 8d08e1e3d6
commit 10ae01f624

View File

@ -80,6 +80,9 @@ func AddrOverNonLocalIP(a ma.Multiaddr) bool {
// as we need to be able to connect to multiple ipfs nodes
// in the same machine.
func AddrUsable(a ma.Multiaddr, partial bool) bool {
if a == nil {
return false
}
if !AddrOverNonLocalIP(a) {
return false