From f19362afdfc248f96c3513b7be1d6b22bcae75e3 Mon Sep 17 00:00:00 2001 From: Aurélien LAJOIE Date: Wed, 20 Feb 2019 14:24:36 +0100 Subject: [weather] Check if the response is not null before decoding it. With network glitch you can have sometimes empty answer, this was triggering an exception. --- weather-widget/weather.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'weather-widget') diff --git a/weather-widget/weather.lua b/weather-widget/weather.lua index 484c2c6..d5f07f8 100644 --- a/weather-widget/weather.lua +++ b/weather-widget/weather.lua @@ -97,7 +97,7 @@ weather_timer:connect_signal("timeout", function () .. secrets.weather_widget_city .. '&appid=' .. secrets.weather_widget_api_key .. '&units=' .. secrets.weather_widget_units) - if (status ~= 200) then + if (status ~= 200 and resp_json ~= nil) then local err_resp = json.decode(resp_json) naughty.notify{ title = 'Weather Widget Error', -- cgit v1.2.3