From f0d269d25972759c97238057c31ffd58d918fad3 Mon Sep 17 00:00:00 2001 From: Umar Farooq Date: Thu, 24 Nov 2022 11:38:43 +0500 Subject: [PATCH] ip_address empty check --- ipinfo/handler.py | 2 +- ipinfo/handler_async.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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