From: ShadowNinja Date: Sun, 13 Apr 2014 21:50:46 +0000 (-0400) Subject: Add checks for nil in minetest.after X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=dcafad2f736aa9b7174bdf7313735d89b981e0c6;p=zefram%2Fminetest%2Fminetest_engine.git Add checks for nil in minetest.after --- diff --git a/builtin/misc.lua b/builtin/misc.lua index 1d5e146c..f91f5e09 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