From 9d08717c83c769e5daea39647ae39fbe1842266c Mon Sep 17 00:00:00 2001 From: JonnyWong16 Date: Fri, 2 Mar 2018 15:39:05 -0800 Subject: [PATCH] Fix missing country in whois lookup causing error --- plexpy/helpers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plexpy/helpers.py b/plexpy/helpers.py index 1e5ca7f1..01759272 100644 --- a/plexpy/helpers.py +++ b/plexpy/helpers.py @@ -646,7 +646,7 @@ def whois_lookup(ip_address): countries = ipwhois.utils.get_countries() nets = whois['nets'] for net in nets: - net['country'] = countries[net['country']] + net['country'] = countries.get(net['country']) if net['postal_code']: net['postal_code'] = net['postal_code'].replace('-', ' ') except ValueError as e: