diff --git a/ipinfo/handler.py b/ipinfo/handler.py index 698a1d8..4276a22 100644 --- a/ipinfo/handler.py +++ b/ipinfo/handler.py @@ -111,7 +111,7 @@ def getDetails(self, ip_address=None, timeout=None): ip_address = ip_address.exploded # check if bogon. - if is_bogon(ip_address): + if ip_address and is_bogon(ip_address): details = {} details["ip"] = ip_address details["bogon"] = True diff --git a/ipinfo/handler_async.py b/ipinfo/handler_async.py index 299e300..170413a 100644 --- a/ipinfo/handler_async.py +++ b/ipinfo/handler_async.py @@ -136,7 +136,7 @@ async def getDetails(self, ip_address=None, timeout=None): ip_address = ip_address.exploded # check if bogon. - if is_bogon(ip_address): + if ip_address and is_bogon(ip_address): details = {} details["ip"] = ip_address details["bogon"] = True