diff --git a/lib/location.py b/lib/location.py index 80b8c82..641f9ec 100644 --- a/lib/location.py +++ b/lib/location.py @@ -108,7 +108,7 @@ def ip2location(ip_addr): except requests.exceptions.ConnectionError: pass - if ';' in location: + if location and ';' in location: location = location.split(';')[3], location.split(';')[1] else: location = location, None