diff --git a/username/username_keybase.py b/username/username_keybase.py index 0bdeb47e..8e586656 100644 --- a/username/username_keybase.py +++ b/username/username_keybase.py @@ -24,7 +24,7 @@ def main(username): url = "https://keybase.io/_/api/1.0/user/lookup.json?usernames=%s" %username req = requests.get(url) data = json.loads(req.text) - if data['them'][0] is not None: + if 'them' in data and data['them'][0] is not None: dict_them = data['them'][0] return dict_them else: