diff options
author | madmaxoft <github@xoft.cz> | 2014-05-02 12:23:01 +0200 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2014-05-02 12:35:35 +0200 |
commit | 0cfa0c45610cbe5c7ae6a03034f81416699247c4 (patch) | |
tree | ee60a9faa2b455d704d5550d358935d5fc20b7f2 /MCServer | |
parent | HOOK_DISCONNECT has cClientHandle as its first parameter. (diff) | |
download | cuberite-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 |
Diffstat (limited to 'MCServer')
-rw-r--r-- | MCServer/Plugins/APIDump/main_APIDump.lua | 6 |
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 |