From dcafad2f736aa9b7174bdf7313735d89b981e0c6 Mon Sep 17 00:00:00 2001 From: ShadowNinja Date: Sun, 13 Apr 2014 17:50:46 -0400 Subject: [PATCH] Add checks for nil in minetest.after --- builtin/misc.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/builtin/misc.lua b/builtin/misc.lua index 1d5e146c6..f91f5e095 100644 --- a/builtin/misc.lua +++ b/builtin/misc.lua @@ -21,6 +21,8 @@ minetest.register_globalstep(function(dtime) end) function minetest.after(time, func, ...) + assert(tonumber(time) and type(func) == "function", + "Invalid minetest.after invocation") table.insert(minetest.timers_to_add, {time=time, func=func, args={...}}) end