diff options
author | Mattes D <github@xoft.cz> | 2014-05-10 21:27:57 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-05-10 21:27:57 +0200 |
commit | 28815252e6ff086c0fab7cf56be4839f3d8612a3 (patch) | |
tree | 4532e85cbcc873a2616147713e9f899ecf84d111 /MCServer/Plugins/APIDump/main_APIDump.lua | |
parent | Client cert is not requested. (diff) | |
parent | Merge pull request #993 from mc-server/GridStructGen (diff) | |
download | cuberite-28815252e6ff086c0fab7cf56be4839f3d8612a3.tar cuberite-28815252e6ff086c0fab7cf56be4839f3d8612a3.tar.gz cuberite-28815252e6ff086c0fab7cf56be4839f3d8612a3.tar.bz2 cuberite-28815252e6ff086c0fab7cf56be4839f3d8612a3.tar.lz cuberite-28815252e6ff086c0fab7cf56be4839f3d8612a3.tar.xz cuberite-28815252e6ff086c0fab7cf56be4839f3d8612a3.tar.zst cuberite-28815252e6ff086c0fab7cf56be4839f3d8612a3.zip |
Diffstat (limited to 'MCServer/Plugins/APIDump/main_APIDump.lua')
-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 |