naughty: Fix getting a notification by id.
There is more into that table than just screens. If `get_by_id` was called with an invalid notification (or a "future" one in case of suspended / do_not_disturb), it would explode.
This commit is contained in:
parent
f81723733c
commit
0d1e977917
|
@ -394,8 +394,8 @@ end
|
||||||
-- @staticfct naughty.get_by_id
|
-- @staticfct naughty.get_by_id
|
||||||
function naughty.get_by_id(id)
|
function naughty.get_by_id(id)
|
||||||
-- iterate the notifications to get the notfications with the correct ID
|
-- iterate the notifications to get the notfications with the correct ID
|
||||||
for s in pairs(naughty.notifications) do
|
for s in capi.screen do
|
||||||
for p in pairs(naughty.notifications[s]) do
|
for p in pairs(naughty.notifications[s] or {}) do
|
||||||
for _, notification in pairs(naughty.notifications[s][p]) do
|
for _, notification in pairs(naughty.notifications[s][p]) do
|
||||||
if notification.id == id then
|
if notification.id == id then
|
||||||
return notification
|
return notification
|
||||||
|
|
Loading…
Reference in New Issue