[timer] Handle cancel(nil) as NOP.

This commit is contained in:
Lorenzo Cogotti 2023-09-19 18:11:17 +02:00
parent 2abcf253ca
commit f6e031a98a
1 changed files with 3 additions and 1 deletions

View File

@ -88,7 +88,9 @@ function Timer:every(delay, after, count)
end
function Timer:cancel(handle)
self.functions[handle] = nil
if handle then
self.functions[handle] = nil
end
end
function Timer:clear()