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,11 +573,13 @@ if ldoc.prettify_files then
for F in file_list:iter() do for F in file_list:iter() do
files:append(F.filename) files:append(F.filename)
local mod = F.modules[1] local mod = F.modules[1]
local ls = List() if mod then
for item in mod.items:iter() do local ls = List()
ls:append(item.lineno) for item in mod.items:iter() do
ls:append(item.lineno)
end
linemap[F.filename] = ls
end end
linemap[F.filename] = ls
end end
if type(ldoc.prettify_files) == 'table' then if type(ldoc.prettify_files) == 'table' then