Skip to content

Commit 1454649

Browse files
committed
check nil
1 parent 5abdc68 commit 1454649

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

script/core/diagnostics/helper/missing-doc-helper.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,17 @@ end
3838

3939
local function checkFunction(source, callback, commentId, paramId, returnId)
4040
local functionName = source.parent[1]
41+
local argCount = source.args and #source.args or 0
4142

42-
if #source.args == 0 and not source.returns and not source.bindDocs then
43+
if argCount == 0 and not source.returns and not source.bindDocs then
4344
callback {
4445
start = source.start,
4546
finish = source.finish,
4647
message = lang.script(commentId, functionName),
4748
}
4849
end
4950

50-
if #source.args > 0 then
51+
if argCount > 0 then
5152
for _, arg in ipairs(source.args) do
5253
local argName = arg[1]
5354
if argName ~= 'self' then

0 commit comments

Comments
 (0)