aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShadowNinja <shadowninja@minetest.net>2014-04-13 17:50:46 -0400
committerShadowNinja <shadowninja@minetest.net>2014-04-13 17:54:00 -0400
commitdcafad2f736aa9b7174bdf7313735d89b981e0c6 (patch)
treeac4e37559ca617c07adbfa6e60090ecbec4896dc
parentb04872d96b54f0a22a972d3a0f16ccef84972d3f (diff)
downloadminetest-dcafad2f736aa9b7174bdf7313735d89b981e0c6.tar.gz
minetest-dcafad2f736aa9b7174bdf7313735d89b981e0c6.tar.bz2
minetest-dcafad2f736aa9b7174bdf7313735d89b981e0c6.zip
Add checks for nil in minetest.after
-rw-r--r--builtin/misc.lua2
1 files changed, 2 insertions, 0 deletions
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