fix(doc): check if modmt exists before trying to get module prop docs

extended-job-api
TorchedSammy 2022-05-08 16:02:24 -04:00
parent dd678a4a75
commit 15035c02cb
Signed by: sammyette
GPG Key ID: 904FC49417B44DCD
1 changed files with 12 additions and 10 deletions

View File

@ -58,6 +58,7 @@ commander.register('doc', function(args)
local propstr = ''
local modDesc = ''
local modmt = getmetatable(require(mod))
if modmt then
modDesc = modmt.__doc
if modmt.__docProp then
-- not all modules have docs for properties
@ -70,6 +71,7 @@ commander.register('doc', function(args)
end
desc = string.format(modDocFormat, modDesc, propstr)
end
end
print(desc .. formattedFuncs)
f:close()