From e1930bedfbb11083affbc10393363a34d844635d Mon Sep 17 00:00:00 2001 From: Igor Chubin Date: Wed, 15 May 2019 17:54:39 +0200 Subject: [PATCH] lib/location.py: location can be None (#296) --- lib/location.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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