From 8493fd1829ed0f2ebf655d2c77c50bdb1c7deb7f Mon Sep 17 00:00:00 2001 From: Anton Bulakh Date: Mon, 11 Mar 2019 20:45:31 +0200 Subject: [PATCH] Add forgotten nil-check to `notification.reset_timeout` When you call `reset_timeout` on a notification with 0 timeout and thus no timer, a nil field error occures. (can be tested with `awesome-client 'require"naughty".notification{message="TEST",timeout=0}:reset_timeout()'`) Everywhere else in similar places (even at the beginning of the `reset_timeout`) the `self.timer` field is checked so i guess it was just forgotten there. --- lib/naughty/notification.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/naughty/notification.lua b/lib/naughty/notification.lua index ba3955c9..f01124bd 100644 --- a/lib/naughty/notification.lua +++ b/lib/naughty/notification.lua @@ -266,7 +266,7 @@ function notification:reset_timeout(new_timeout) self.timeout = new_timeout or self.timeout - if not self.timer.started then + if self.timer and not self.timer.started then self.timer:start() end end