Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #279 from coolaj86/patch-1
allow the user to pass in a nil timer
  • Loading branch information
rphillips committed Jul 23, 2012
2 parents b189333 + db983f2 commit aef0f61
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/luvit/timer.lua
Expand Up @@ -173,7 +173,10 @@ local function setInterval(period, callback, ...)
end
local function clearTimer(timer)
if timer and timer._onTimeout then
if not timer then
return
end
if timer._onTimeout then
timer._onTimeout = nil
if timer.close then
timer:close()
Expand Down

0 comments on commit aef0f61

Please sign in to comment.