Skip to content
Snippets Groups Projects
Commit 80cebdc2 authored by HybridDog's avatar HybridDog Committed by est31
Browse files

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
parent ab7a5c4f
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment