Fix error iterating nil object when mapping functions to line numbers (#320)

This commit is contained in:
wesley 2020-09-30 06:42:16 +10:00 committed by GitHub
parent f97850dee6
commit 794fd0e14e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 4 deletions

View File

@ -573,12 +573,14 @@ if ldoc.prettify_files then
for F in file_list:iter() do
files:append(F.filename)
local mod = F.modules[1]
if mod then
local ls = List()
for item in mod.items:iter() do
ls:append(item.lineno)
end
linemap[F.filename] = ls
end
end
if type(ldoc.prettify_files) == 'table' then
files = tools.expand_file_list(ldoc.prettify_files, '*.*')