Merge pull request #69 from utix/master

Fix error when the response is empty
This commit is contained in:
streetturtle 2019-02-20 09:06:19 -05:00 committed by GitHub
commit 83fedf0293
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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',