diff options
author | HybridDog <ovvv@web.de> | 2016-06-28 06:34:22 +0200 |
---|---|---|
committer | est31 <est31@users.noreply.github.com> | 2016-06-28 06:34:22 +0200 |
commit | 80cebdc23c29ed778958ba3a35662cbc5f5e2f09 (patch) | |
tree | dcc29e32c574ad1ef015cb3ff3d4bef20442e840 /builtin/common | |
parent | ab7a5c4ff138c39a2491592731d677c9f392caa0 (diff) | |
download | minetest-80cebdc23c29ed778958ba3a35662cbc5f5e2f09.tar.gz minetest-80cebdc23c29ed778958ba3a35662cbc5f5e2f09.tar.bz2 minetest-80cebdc23c29ed778958ba3a35662cbc5f5e2f09.zip |
Only allow strings to be passed to minetest.global_exists (#4253)
Sometimes you accidentally forget the quotes when using global_exists, this makes minetest abort if you did so.
M builtin/common/strict.lua
Diffstat (limited to 'builtin/common')
-rw-r--r-- | builtin/common/strict.lua | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/builtin/common/strict.lua b/builtin/common/strict.lua index 05ceadf7a..23ba3d727 100644 --- a/builtin/common/strict.lua +++ b/builtin/common/strict.lua @@ -5,6 +5,9 @@ local WARN_INIT = false function core.global_exists(name) + if type(name) ~= "string" then + error("core.global_exists: " .. tostring(name) .. " is not a string") + end return rawget(_G, name) ~= nil end |