summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-10-20 20:14:00 +0200
committerMattes D <github@xoft.cz>2014-10-20 20:14:00 +0200
commitd79d5945e3275ac0a0d63c185790ac41a51eda87 (patch)
tree600e05009cb2a5a4407bb5323d4d6ae1e819c164
parentMerge pull request #1554 from SphinxC0re/master (diff)
downloadcuberite-d79d5945e3275ac0a0d63c185790ac41a51eda87.tar
cuberite-d79d5945e3275ac0a0d63c185790ac41a51eda87.tar.gz
cuberite-d79d5945e3275ac0a0d63c185790ac41a51eda87.tar.bz2
cuberite-d79d5945e3275ac0a0d63c185790ac41a51eda87.tar.lz
cuberite-d79d5945e3275ac0a0d63c185790ac41a51eda87.tar.xz
cuberite-d79d5945e3275ac0a0d63c185790ac41a51eda87.tar.zst
cuberite-d79d5945e3275ac0a0d63c185790ac41a51eda87.zip
Diffstat (limited to '')
-rw-r--r--MCServer/Plugins/InfoDump.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/MCServer/Plugins/InfoDump.lua b/MCServer/Plugins/InfoDump.lua
index bc9bab767..de1d1f451 100644
--- a/MCServer/Plugins/InfoDump.lua
+++ b/MCServer/Plugins/InfoDump.lua
@@ -625,7 +625,11 @@ local function LoadPluginInfo(a_FolderName)
-- This is Lua-5.1-specific and won't work in Lua 5.2!
local Sandbox = {}
setfenv(cfg, Sandbox)
- cfg()
+ local isSuccess, errMsg = pcall(cfg)
+ if not(isSuccess) then
+ return nil, "Cannot load Info.lua: " .. (errMsg or "<unknown error>")
+ end
+
if (Sandbox.g_PluginInfo == nil) then
return nil, "Info.lua doesn't contain the g_PluginInfo declaration"
end