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 3037ac2e34
commit dec34b48e3
1 changed files with 3 additions and 0 deletions

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