Skip to content

Commit a46f959

Browse files
committed
fix(diagnostics): fix unbalanced assignments causing a nil index for missing-export-doc
1 parent 497eb21 commit a46f959

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ return function (uri, callback)
1818
---@async
1919
guide.eachSourceType(state.ast, 'setfield', function (source)
2020
await.delay()
21+
if not source.value then return end -- if the assignment is unbalanced then there is no value
2122
if source.value.type ~= "function" then return end
2223

2324
-- TODO: find a better way to distinguish a.b = function and function a.b, or alternatively make them both work

0 commit comments

Comments
 (0)