From: HybridDog Date: Tue, 28 Jun 2016 04:34:22 +0000 (+0200) Subject: Only allow strings to be passed to minetest.global_exists (#4253) X-Git-Tag: 0.4.15~343 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=80cebdc23c29ed778958ba3a35662cbc5f5e2f09;p=oweals%2Fminetest.git 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 --- 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