summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorsumneko <sumneko@hotmail.com>2019-04-29 21:53:39 +0800
committersumneko <sumneko@hotmail.com>2019-04-29 21:53:39 +0800
commit146ea3c19fc1fb2244cc305fbf4fae0ed266b976 (patch)
treecc2f0bd0c5b31a9553bbd3346127addc3a4be9bd /server
parentbb56cb2c21bf6a6c7a6c3bf6bb069bc69c1f903c (diff)
downloadlua-language-server-146ea3c19fc1fb2244cc305fbf4fae0ed266b976.zip
先判空吧,等以后重构
Diffstat (limited to 'server')
-rw-r--r--server/src/vm/function.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/server/src/vm/function.lua b/server/src/vm/function.lua
index 6eb6fc1f..2322fa70 100644
--- a/server/src/vm/function.lua
+++ b/server/src/vm/function.lua
@@ -56,6 +56,9 @@ function mt:saveLocal(name, loc)
if loc.type ~= 'local' then
error('saveLocal必须是local')
end
+ if not loc:getSource() then
+ return
+ end
local old = self:loadLocal(name)
if old then
loc:shadow(old)