summaryrefslogtreecommitdiff
path: root/script/core
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-02-21 15:34:04 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-02-21 15:34:04 +0800
commite4588e924ae897f4b6d5d6133200a6d85dc4dfe0 (patch)
tree2f69040f10034b75f4347e5ca8ffa7838020e4a4 /script/core
parentd59f9824a567aa1a18b5e0e794efdb2e658bbb35 (diff)
downloadlua-language-server-e4588e924ae897f4b6d5d6133200a6d85dc4dfe0.zip
fix runtime errors
Diffstat (limited to 'script/core')
-rw-r--r--script/core/noder.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/script/core/noder.lua b/script/core/noder.lua
index 0a04a744..fcc6b6f4 100644
--- a/script/core/noder.lua
+++ b/script/core/noder.lua
@@ -186,7 +186,11 @@ local function getFieldEventName(field)
if not secondTypeUnit or secondTypeUnit.type ~= 'doc.type.function' then
return nil
end
- local eventName = firstEnum[1]:match [[^['"](.+)['"]$]]
+ local enmuStr = firstEnum[1]
+ if type(enmuStr) ~= 'string' then
+ return nil
+ end
+ local eventName = enmuStr:match [[^['"](.+)['"]$]]
field._eventName = eventName
return eventName
end