diff --git a/geoip.go b/geoip.go index 47e6a735..3af68148 100644 --- a/geoip.go +++ b/geoip.go @@ -42,6 +42,9 @@ func (g *GeoIP) GetCountryRegion(ip net.IP) (country, continent, regionGroup, re } record := geoIP.city.GetRecord(ip.String()) + if record == nil { + return + } country = record.CountryCode region = record.Region