weather.forecast_update: forgot to add check on err

This commit is contained in:
luke bonham 2015-07-03 18:10:03 +02:00
parent 8468b88f4a
commit 538269c108
1 changed files with 1 additions and 1 deletions

View File

@ -75,7 +75,7 @@ local function worker(args)
f:close() f:close()
weather_now, pos, err = json.decode(j, 1, nil) weather_now, pos, err = json.decode(j, 1, nil)
if not err and tonumber(weather_now["cod"]) == 200 then if not err and weather_now ~= nil and tonumber(weather_now["cod"]) == 200 then
weather.notification_text = '' weather.notification_text = ''
for i = 1, weather_now["cnt"] do for i = 1, weather_now["cnt"] do
local f = assert(io.popen(string.format(date_cmd, weather_now["list"][i]["dt"]))) local f = assert(io.popen(string.format(date_cmd, weather_now["list"][i]["dt"])))