Skip to content

Commit

Permalink
Fix handling of GeoIP lookup failure
Browse files Browse the repository at this point in the history
  • Loading branch information
sfan5 committed Jul 17, 2019
1 parent 772fc29 commit 85c3048
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server.py
Expand Up @@ -284,7 +284,7 @@ def asyncFinishThread(server):
except geoip2.errors.GeoIP2Error:
app.logger.warning("GeoIP lookup failure for %s." % (server["address"],))

if "continent" in geo and "code" in geo["continent"]:
if geo and "continent" in geo:
server["geo_continent"] = geo["continent"]["code"]
else:
app.logger.warning("Unable to get GeoIP Continent data for %s."
Expand Down

0 comments on commit 85c3048

Please sign in to comment.