Skip to content

Commit f0d269d

Browse files
committed
ip_address empty check
1 parent a003e43 commit f0d269d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

ipinfo/handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def getDetails(self, ip_address=None, timeout=None):
111111
ip_address = ip_address.exploded
112112

113113
# check if bogon.
114-
if is_bogon(ip_address):
114+
if ip_address and is_bogon(ip_address):
115115
details = {}
116116
details["ip"] = ip_address
117117
details["bogon"] = True

ipinfo/handler_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ async def getDetails(self, ip_address=None, timeout=None):
136136
ip_address = ip_address.exploded
137137

138138
# check if bogon.
139-
if is_bogon(ip_address):
139+
if ip_address and is_bogon(ip_address):
140140
details = {}
141141
details["ip"] = ip_address
142142
details["bogon"] = True

0 commit comments

Comments
 (0)