diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2010-10-29 00:00:43 -0700 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2010-10-29 00:00:43 -0700 |
commit | 7a48fd845542c6ee36ebc42c8af731a66da9082e (patch) | |
tree | fe1659cd78a90dc8bb3341f93c567c5fa225bf10 /lib/timers.js | |
parent | fa7dcbec8be1332f16e62675203598f4bb15645c (diff) | |
download | node-new-7a48fd845542c6ee36ebc42c8af731a66da9082e.tar.gz |
Handle null values in clearTimeout
Diffstat (limited to 'lib/timers.js')
-rw-r--r-- | lib/timers.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/timers.js b/lib/timers.js index b835ba5864..cb049b0333 100644 --- a/lib/timers.js +++ b/lib/timers.js @@ -209,9 +209,11 @@ exports.setTimeout = function (callback, after) { exports.clearTimeout = function (timer) { - timer.callback = timer._onTimeout = null; - exports.unenroll(timer); - if (timer instanceof Timer) timer.stop(); // for after === 0 + if (timer) { + timer.callback = timer._onTimeout = null; + exports.unenroll(timer); + if (timer instanceof Timer) timer.stop(); // for after === 0 + } }; |