From 3c2fae666a2bd49305a3e3fe620e24133da5cee5 Mon Sep 17 00:00:00 2001 From: Daniel Oaks Date: Thu, 13 Oct 2016 16:34:04 +1000 Subject: [PATCH] net: Fix issue where some local clients would break. Ran into this on Windows, when it didn't return "localhost" as a possible name for 127.0.0.1 or ::1. --- irc/net.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/irc/net.go b/irc/net.go index f291a347..b8a0040a 100644 --- a/irc/net.go +++ b/irc/net.go @@ -24,7 +24,7 @@ func AddrLookupHostname(addr net.Addr) string { func LookupHostname(addr string) string { names, err := net.LookupAddr(addr) - if err != nil || !IsHostname(names[0]) { + if err != nil || len(names) < 1 || !IsHostname(names[0]) { // return original address return addr }