summaryrefslogtreecommitdiff
path: root/script/vm
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-04-24 16:42:30 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-04-24 16:42:30 +0800
commit01a4bfa62d3583ade899e69a92c290ee57fb9251 (patch)
tree515c14947201a1163de95b216258866a542eed8f /script/vm
parent4876ff34f6c7ab8c234577ebf5f8a96d867b4f31 (diff)
downloadlua-language-server-01a4bfa62d3583ade899e69a92c290ee57fb9251.zip
fix #1088
Diffstat (limited to 'script/vm')
-rw-r--r--script/vm/compiler.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/script/vm/compiler.lua b/script/vm/compiler.lua
index 32cc7128..ec3b28bc 100644
--- a/script/vm/compiler.lua
+++ b/script/vm/compiler.lua
@@ -803,8 +803,10 @@ function vm.compileCallArg(arg, call, index)
if call.node.special == 'pcall'
or call.node.special == 'xpcall' then
local fixIndex = call.node.special == 'pcall' and 1 or 2
- callNode = vm.compileNode(call.args[1])
- compileCallArgNode(arg, call, callNode, fixIndex, index - fixIndex)
+ if call.args and call.args[1] then
+ callNode = vm.compileNode(call.args[1])
+ compileCallArgNode(arg, call, callNode, fixIndex, index - fixIndex)
+ end
end
return vm.getNode(arg)
end