mirror of
				https://github.com/luanti-org/luanti.git
				synced 2025-11-04 09:15:29 +01:00 
			
		
		
		
	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
This commit is contained in:
		@@ -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
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user