summaryrefslogtreecommitdiff
path: root/script/core/diagnostics/global-in-nil-env.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-04-25 01:23:50 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-04-25 01:23:50 +0800
commit125d943a7faec97b7169d0088a12ba6a44a14c16 (patch)
tree40b5a7d8d55571334c5ddecd302fe89c34969c84 /script/core/diagnostics/global-in-nil-env.lua
parent163da759468164bc020fb4801bf06f1a190af7ad (diff)
downloadlua-language-server-125d943a7faec97b7169d0088a12ba6a44a14c16.zip
add `---@cast`
Diffstat (limited to 'script/core/diagnostics/global-in-nil-env.lua')
-rw-r--r--script/core/diagnostics/global-in-nil-env.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/script/core/diagnostics/global-in-nil-env.lua b/script/core/diagnostics/global-in-nil-env.lua
index d95963e4..334fd81a 100644
--- a/script/core/diagnostics/global-in-nil-env.lua
+++ b/script/core/diagnostics/global-in-nil-env.lua
@@ -16,7 +16,7 @@ return function (uri, callback)
local env = guide.getENV(root)
local nilDefs = {}
- if not env.ref then
+ if not env or not env.ref then
return
end
for _, ref in ipairs(env.ref) do