summaryrefslogtreecommitdiffstats
path: root/MCServer
diff options
context:
space:
mode:
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