diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-10-13 10:04:39 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-10-13 10:04:39 +0800 |
commit | c27a44e9e77911efe5646715c2b3e42bb8409826 (patch) | |
tree | 6854301c5dae4844758e272ed1a2ac3fc54d221e /script-beta/core/hover/label.lua | |
parent | c3f0a9cfafe752fc28b39ec341e4479c3012e5ce (diff) | |
download | lua-language-server-c27a44e9e77911efe5646715c2b3e42bb8409826.zip |
判空
Diffstat (limited to 'script-beta/core/hover/label.lua')
-rw-r--r-- | script-beta/core/hover/label.lua | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/script-beta/core/hover/label.lua b/script-beta/core/hover/label.lua index e0032979..3b1c5d0a 100644 --- a/script-beta/core/hover/label.lua +++ b/script-beta/core/hover/label.lua @@ -126,6 +126,9 @@ local function asNumber(source) end local uri = guide.getUri(source) local text = files.getText(uri) + if not text then + return nil + end local raw = text:sub(source.start, source.finish) if not raw or not raw:find '[^%-%d%.]' then return nil |