diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2024-06-13 18:10:57 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2024-06-13 18:10:57 +0800 |
commit | 85cb44556575f81a31267fe3c443822f3e97699e (patch) | |
tree | 303595145b46535cf0b53b5608bdbf6c882bc929 | |
parent | 2dfb12ad3759acb7ff47b4c5c54ad0a62c598b22 (diff) | |
download | lua-language-server-85cb44556575f81a31267fe3c443822f3e97699e.zip |
判空
-rw-r--r-- | script/vm/global.lua | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/script/vm/global.lua b/script/vm/global.lua index aa987cf4..ed2b4802 100644 --- a/script/vm/global.lua +++ b/script/vm/global.lua @@ -382,12 +382,14 @@ local compilerGlobalSwitch = util.switch() [1] = field.field[1], } elseif field.type == 'tableindex' then - source._enums[#source._enums+1] = { - type = 'doc.type.string', - start = field.index.start, - finish = field.index.finish, - [1] = field.index[1], - } + if field.index then + source._enums[#source._enums+1] = { + type = 'doc.type.string', + start = field.index.start, + finish = field.index.finish, + [1] = field.index[1], + } + end end end else |