summaryrefslogtreecommitdiff
path: root/script/core/noder.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-08-18 14:35:37 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-08-18 14:35:37 +0800
commit8d8c4359a855b02e663f8122fee8de34b06a9fd0 (patch)
tree9811147b439e0bd8fcb4e08f4f6a69a7476c5c6e /script/core/noder.lua
parente713e3f7f9d88ea4683b74749bed6e26fe222288 (diff)
downloadlua-language-server-8d8c4359a855b02e663f8122fee8de34b06a9fd0.zip
fix runtime errors
Diffstat (limited to 'script/core/noder.lua')
-rw-r--r--script/core/noder.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/script/core/noder.lua b/script/core/noder.lua
index 40a0bb82..a63a1c25 100644
--- a/script/core/noder.lua
+++ b/script/core/noder.lua
@@ -313,7 +313,10 @@ local getKeyMap = util.switch()
: call(function (source)
local name = source[1]
if source.typeGeneric then
- return 'dg:' .. source.typeGeneric[name][1].start, nil
+ local first = source.typeGeneric[name][1]
+ if first then
+ return 'dg:' .. first.start, nil
+ end
else
return 'dn:' .. name, nil
end