summaryrefslogtreecommitdiff
path: root/script/core
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-06-21 16:40:07 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-06-21 16:40:07 +0800
commit8af599790936f81cddaecb31d36eede70ad3739c (patch)
tree184f86524a29848869801ae01f2f21e3b4da1878 /script/core
parent8f4f9a7122168ba3944ec4fa791b94c8eff8750f (diff)
downloadlua-language-server-8af599790936f81cddaecb31d36eede70ad3739c.zip
fix
Diffstat (limited to 'script/core')
-rw-r--r--script/core/completion/completion.lua2
-rw-r--r--script/core/diagnostics/assign-type-mismatch.lua2
2 files changed, 2 insertions, 2 deletions
diff --git a/script/core/completion/completion.lua b/script/core/completion/completion.lua
index 1ddd9890..165dbac5 100644
--- a/script/core/completion/completion.lua
+++ b/script/core/completion/completion.lua
@@ -1241,7 +1241,7 @@ local function tryIndex(state, position, results)
if not parent then
return
end
- local word = parent.next.index[1]
+ local word = parent.next and parent.next.index and parent.next.index[1]
checkField(state, word, position, position, parent, oop, results)
end
diff --git a/script/core/diagnostics/assign-type-mismatch.lua b/script/core/diagnostics/assign-type-mismatch.lua
index c6a4195c..ae4b3512 100644
--- a/script/core/diagnostics/assign-type-mismatch.lua
+++ b/script/core/diagnostics/assign-type-mismatch.lua
@@ -50,7 +50,7 @@ return function (uri, callback)
end
end
end
- local varNode = vm.compileNode(source)
+ local varNode = vm.compileNode(source)
if vm.canCastType(uri, varNode, valueNode) then
return
end