summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/rbot/timer.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/rbot/timer.rb b/lib/rbot/timer.rb
index c87c9c4d..db0c6ea1 100644
--- a/lib/rbot/timer.rb
+++ b/lib/rbot/timer.rb
@@ -117,16 +117,19 @@ module Timer
# block action with handle +handle+
def block(handle)
+ raise "no such timer #{handle}" unless @timers[handle]
@timers[handle].blocked = true
end
# unblock action with handle +handle+
def unblock(handle)
+ raise "no such timer #{handle}" unless @timers[handle]
@timers[handle].blocked = false
end
# reschedule action with handle +handle+ to change its period
def reschedule(handle, period)
+ raise "no such timer #{handle}" unless @timers[handle]
@timers[handle].reschedule(period)
end