Skip to content

Commit dd1bcd8

Browse files
committed
check nil
1 parent af662de commit dd1bcd8

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

script/vm/tracer.lua

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ local lookIntoChild = util.switch()
627627
---@param action parser.object
628628
---@param topNode vm.node
629629
---@param outNode? vm.node
630-
: call(function (tracer, action, topNode, outNode)
630+
: call(function (tracer, action, topNode, outNode)
631631
if not action[1] or not action[2] then
632632
tracer:lookIntoChild(action[1], topNode)
633633
tracer:lookIntoChild(action[2], topNode)
@@ -677,8 +677,10 @@ local lookIntoChild = util.switch()
677677
end
678678
elseif handler.type == 'getfield'
679679
and handler.node.type == 'getlocal' then
680-
local tys = getNodeTypesWithLiteralField(
681-
tracer.uri, handler.node, handler.field[1], checker)
680+
local tys
681+
if handler.field then
682+
tys = getNodeTypesWithLiteralField(tracer.uri, handler.node, handler.field[1], checker)
683+
end
682684

683685
-- TODO: handle more types
684686
if tys and #tys == 1 then

0 commit comments

Comments
 (0)