Check that the services array is not nil before indexing it
This may happen when e.g. the connman service is restarted.
This commit is contained in:
parent
818e556974
commit
e917b699a9
|
@ -229,7 +229,12 @@ cdbus.connect_signal(
|
|||
-- "addded" should be a list of {object_path, properties_table} pairs,
|
||||
-- but the Awesome API returns nil instead of an object_path
|
||||
-- so we're forced to update all the services.
|
||||
current_service = connman:GetServices()[1]
|
||||
local services = connman:GetServices()
|
||||
if services then
|
||||
current_service = services[1]
|
||||
else
|
||||
current_service = nil
|
||||
end
|
||||
widget:update()
|
||||
elseif info.member == "PropertyChanged" then
|
||||
local name, value = unpack({...})
|
||||
|
|
Loading…
Reference in New Issue