From 487cb13e14ab36b04395835df0eaac9a6eefb9be Mon Sep 17 00:00:00 2001 From: nemunaire Date: Sat, 27 Jun 2015 18:14:45 +0200 Subject: [PATCH] [weather] fix some hypothetical errors --- modules/weather.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/weather.py b/modules/weather.py index 19e8f8f..a36306e 100644 --- a/modules/weather.py +++ b/modules/weather.py @@ -131,7 +131,7 @@ def get_json_weather(coords): wth = web.getJSON(URL_DSAPI % (float(coords[0]), float(coords[1]))) # First read flags - if "darksky-unavailable" in wth["flags"]: + if wth is None or "darksky-unavailable" in wth["flags"]: raise IRCException("The given location is supported but a temporary error (such as a radar station being down for maintenace) made data unavailable.") return wth