[weather] fix some hypothetical errors
This commit is contained in:
parent
d90c44de49
commit
487cb13e14
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user