diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-10-09 16:49:47 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-10-09 16:49:47 +0800 |
commit | 493912dfd2eb7d570ecf1041d1a8c69350a65caf (patch) | |
tree | 9626dd59d7927eb8c0348659e7b0d62260917012 /script-beta | |
parent | b5311472564006622cc3a2c79dc105a488ca5360 (diff) | |
download | lua-language-server-493912dfd2eb7d570ecf1041d1a8c69350a65caf.zip |
还是要判空
Diffstat (limited to 'script-beta')
-rw-r--r-- | script-beta/core/document-symbol.lua | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/script-beta/core/document-symbol.lua b/script-beta/core/document-symbol.lua index 6f3e788f..dd58fe82 100644 --- a/script-beta/core/document-symbol.lua +++ b/script-beta/core/document-symbol.lua @@ -94,11 +94,17 @@ local function buildValue(source, symbols) sRange = { source.start, source.finish } kind = skind.Class elseif source.type == 'tablefield' then + if not source.field then + return + end details[1] = 'field' range = { source.field.start, source.field.finish } sRange = { source.field.start, source.field.finish } kind = skind.Property elseif source.type == 'setfield' then + if not source.field then + return + end details[1] = 'field' range = { source.field.start, source.field.finish } sRange = { source.field.start, source.field.finish } |