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.
This commit is contained in:
Anton Bulakh 2019-03-11 20:45:31 +02:00 committed by GitHub
parent f69b72ab36
commit 8493fd1829
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

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