[timer] Handle cancel(nil) as NOP.

master
Lorenzo Cogotti 1 year ago
parent 2abcf253ca
commit f6e031a98a

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

Loading…
Cancel
Save