Add checks for nil in minetest.after
authorShadowNinja <shadowninja@minetest.net>
Sun, 13 Apr 2014 21:50:46 +0000 (17:50 -0400)
committerShadowNinja <shadowninja@minetest.net>
Sun, 13 Apr 2014 21:54:00 +0000 (17:54 -0400)
builtin/misc.lua

index 1d5e146c60cc7b182f88c714ca9b542786bc4417..f91f5e095d7c3a04728463dac19a9557cf9fd891 100644 (file)
@@ -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