summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-05-02 12:23:01 +0200
committermadmaxoft <github@xoft.cz>2014-05-02 12:35:35 +0200
commit0cfa0c45610cbe5c7ae6a03034f81416699247c4 (patch)
treeee60a9faa2b455d704d5550d358935d5fc20b7f2
parentHOOK_DISCONNECT has cClientHandle as its first parameter. (diff)
downloadcuberite-0cfa0c45610cbe5c7ae6a03034f81416699247c4.tar
cuberite-0cfa0c45610cbe5c7ae6a03034f81416699247c4.tar.gz
cuberite-0cfa0c45610cbe5c7ae6a03034f81416699247c4.tar.bz2
cuberite-0cfa0c45610cbe5c7ae6a03034f81416699247c4.tar.lz
cuberite-0cfa0c45610cbe5c7ae6a03034f81416699247c4.tar.xz
cuberite-0cfa0c45610cbe5c7ae6a03034f81416699247c4.tar.zst
cuberite-0cfa0c45610cbe5c7ae6a03034f81416699247c4.zip
-rw-r--r--MCServer/Plugins/APIDump/main_APIDump.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/MCServer/Plugins/APIDump/main_APIDump.lua b/MCServer/Plugins/APIDump/main_APIDump.lua
index 52199740b..a25bab9cf 100644
--- a/MCServer/Plugins/APIDump/main_APIDump.lua
+++ b/MCServer/Plugins/APIDump/main_APIDump.lua
@@ -27,10 +27,14 @@ local function LoadAPIFiles(a_Folder, a_DstTable)
-- We only want .lua files from the folder:
if (cFile:IsFile(FileName) and fnam:match(".*%.lua$")) then
local TablesFn, Err = loadfile(FileName);
- if (TablesFn == nil) then
+ if (type(TablesFn) ~= "function") then
LOGWARNING("Cannot load API descriptions from " .. FileName .. ", Lua error '" .. Err .. "'.");
else
local Tables = TablesFn();
+ if (type(Tables) ~= "table") then
+ LOGWARNING("Cannot load API descriptions from " .. FileName .. ", returned object is not a table (" .. type(Tables) .. ").");
+ break
+ end
for k, cls in pairs(Tables) do
a_DstTable[k] = cls;
end