Skip to content

Commit 241c518

Browse files
committed
check nil
1 parent f40f0a5 commit 241c518

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

script/core/diagnostics/duplicate-doc-alias.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ return function (uri, callback)
1717
for _, doc in ipairs(state.ast.docs) do
1818
if doc.type == 'doc.alias' then
1919
local name = guide.getKeyName(doc)
20+
if not name then
21+
return
22+
end
2023
if not cache[name] then
2124
local docs = vm.getDocSets(uri, name)
2225
cache[name] = {}

script/core/hover/table.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ local function getNodeMap(fields, keyMap)
154154
local nodeMap = {}
155155
for _, field in ipairs(fields) do
156156
local key = vm.getKeyName(field)
157-
if not keyMap[key] then
157+
if not key or not keyMap[key] then
158158
goto CONTINUE
159159
end
160160
await.delay()

0 commit comments

Comments
 (0)