summaryrefslogtreecommitdiff
path: root/script/vm/node.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-03-08 19:41:06 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-03-08 19:41:06 +0800
commit256b37771a9203ab0c27d5690e35d9a1f9185465 (patch)
treeffe9fda7167f17099dd3bdcfa27ec5c4e51dadca /script/vm/node.lua
parentdd7317a907b88cb102f45535ef19d67b47564c7f (diff)
downloadlua-language-server-256b37771a9203ab0c27d5690e35d9a1f9185465.zip
update
Diffstat (limited to 'script/vm/node.lua')
-rw-r--r--script/vm/node.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/script/vm/node.lua b/script/vm/node.lua
index a8a900ec..f9dbdf3e 100644
--- a/script/vm/node.lua
+++ b/script/vm/node.lua
@@ -5,6 +5,8 @@ local union = require 'vm.union'
---@class vm.node-manager
local m = {}
+local DUMMY_FUNCTION = function () end
+
---@type table<parser.object, vm.node>
m.nodeCache = {}
@@ -38,6 +40,9 @@ end
---@return fun():vm.node
function m.eachNode(node)
+ if not node then
+ return DUMMY_FUNCTION
+ end
if node.type == 'union' then
return node:eachNode()
end