summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorunknown <sumnekosun@intranet.123u.com>2019-04-02 18:00:26 +0800
committerunknown <sumnekosun@intranet.123u.com>2019-04-02 18:00:26 +0800
commita483e2072f50a3f763c8fa63db37b5551050998f (patch)
tree1747c1b437c88c1991c646476d9c33ead34ff295 /server
parenta006de81d0c4c6e97580d5d8ac9dc7a0cb2b5945 (diff)
downloadlua-language-server-a483e2072f50a3f763c8fa63db37b5551050998f.zip
修正报错
Diffstat (limited to 'server')
-rw-r--r--server/src/core/completion.lua3
-rw-r--r--server/src/vm/value.lua2
2 files changed, 4 insertions, 1 deletions
diff --git a/server/src/core/completion.lua b/server/src/core/completion.lua
index c7ac9310..2204c369 100644
--- a/server/src/core/completion.lua
+++ b/server/src/core/completion.lua
@@ -230,6 +230,9 @@ local function searchFields(vm, source, word, callback)
return
end
local v = parent:getChild(k)
+ if not v then
+ return
+ end
if source:get 'object' and v:getType() ~= 'function' then
return
end
diff --git a/server/src/vm/value.lua b/server/src/vm/value.lua
index 73c47cb0..1c7fe04e 100644
--- a/server/src/vm/value.lua
+++ b/server/src/vm/value.lua
@@ -167,7 +167,7 @@ function mt:getChild(index, source)
end
parent = method
end
- if not value then
+ if not value and source then
value = create('any', source)
self:setChild(index, value)
value.uri = self.uri