Skip to content

Commit e67c6b2

Browse files
committed
check nil
1 parent b9b6d21 commit e67c6b2

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

script/core/diagnostics/incomplete-signature-doc.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ return function (uri, callback)
5959

6060
local functionName = source.parent[1]
6161

62-
if #source.args > 0 then
62+
if source.args and #source.args > 0 then
6363
for _, arg in ipairs(source.args) do
6464
local argName = arg[1]
6565
if argName ~= 'self' then

script/core/diagnostics/missing-local-export-doc.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ local function findSetField(ast, name, callback)
1010
await.delay()
1111
if source.node[1] == name then
1212
local funcPtr = source.value.node
13+
if not funcPtr then
14+
return
15+
end
1316
local func = funcPtr.value
1417
if funcPtr.type == 'local' and func.type == 'function' then
1518
helper.CheckFunction(func, callback, 'DIAG_MISSING_LOCAL_EXPORT_DOC_COMMENT', 'DIAG_MISSING_LOCAL_EXPORT_DOC_PARAM', 'DIAG_MISSING_LOCAL_EXPORT_DOC_RETURN')

0 commit comments

Comments
 (0)