summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
Diffstat (limited to 'server')
-rw-r--r--server/src/core/completion.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/server/src/core/completion.lua b/server/src/core/completion.lua
index d02897c7..fcea333d 100644
--- a/server/src/core/completion.lua
+++ b/server/src/core/completion.lua
@@ -245,6 +245,9 @@ end
local function searchCloseGlobal(vm, source, word, callback)
local loc = source:bindLocal()
+ if not loc then
+ return
+ end
local close = loc:close()
-- 因为闭包的关系落在局部变量finish到close范围内的全局变量一定能访问到该局部变量
for _, src in ipairs(vm.sources) do