projects
/
oweals
/
minetest.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ab7a5c4
)
Only allow strings to be passed to minetest.global_exists (#4253)
author
HybridDog
<ovvv@web.de>
Tue, 28 Jun 2016 04:34:22 +0000
(06:34 +0200)
committer
est31
<est31@users.noreply.github.com>
Tue, 28 Jun 2016 04:34:22 +0000
(06:34 +0200)
Sometimes you accidentally forget the quotes when using global_exists, this makes minetest abort if you did so.
M builtin/common/strict.lua
builtin/common/strict.lua
patch
|
blob
|
history
diff --git
a/builtin/common/strict.lua
b/builtin/common/strict.lua
index 05ceadf7afe076f34e9af18f6b62515116551039..23ba3d727a7398a9c0ad0c2f3cfe54669484c889 100644
(file)
--- 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