From 8af599790936f81cddaecb31d36eede70ad3739c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Tue, 21 Jun 2022 16:40:07 +0800 Subject: fix --- script/core/completion/completion.lua | 2 +- script/core/diagnostics/assign-type-mismatch.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'script/core') 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 -- cgit v1.2.3