diff options
author | Tycho <work.tycho+git@gmail.com> | 2014-05-03 15:07:56 +0200 |
---|---|---|
committer | Tycho <work.tycho+git@gmail.com> | 2014-05-03 15:07:56 +0200 |
commit | ec407dd27dc35b5903fdddf2bad307784842d679 (patch) | |
tree | 69c699b9242fcccf4b7ee865b0c6a9842329c0d4 /MCServer/Plugins/APIDump/main_APIDump.lua | |
parent | cCHunkBuffer that compiles with TestGlobals.h (diff) | |
parent | Seperate instructions for OSX and Linux (diff) | |
download | cuberite-ec407dd27dc35b5903fdddf2bad307784842d679.tar cuberite-ec407dd27dc35b5903fdddf2bad307784842d679.tar.gz cuberite-ec407dd27dc35b5903fdddf2bad307784842d679.tar.bz2 cuberite-ec407dd27dc35b5903fdddf2bad307784842d679.tar.lz cuberite-ec407dd27dc35b5903fdddf2bad307784842d679.tar.xz cuberite-ec407dd27dc35b5903fdddf2bad307784842d679.tar.zst cuberite-ec407dd27dc35b5903fdddf2bad307784842d679.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 |