summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--changelog.md1
-rw-r--r--script/vm/compiler.lua2
2 files changed, 2 insertions, 1 deletions
diff --git a/changelog.md b/changelog.md
index 7c5295b4..aa2e95c5 100644
--- a/changelog.md
+++ b/changelog.md
@@ -5,6 +5,7 @@
* `type.weakNilCheck`
* `FIX` [#1256](https://github.com/sumneko/lua-language-server/issues/1256)
* `FIX` [#1257](https://github.com/sumneko/lua-language-server/issues/1257)
+* `FIX` [#1275](https://github.com/sumneko/lua-language-server/issues/1275)
## 3.4.0
`2022-6-29`
diff --git a/script/vm/compiler.lua b/script/vm/compiler.lua
index 37042d76..e361d706 100644
--- a/script/vm/compiler.lua
+++ b/script/vm/compiler.lua
@@ -1012,7 +1012,7 @@ local function compileLocal(source)
-- for x in ... do
if source.parent.type == 'in' then
compileForVars(source.parent)
- local keyNode = source.parent._iterVars[source]
+ local keyNode = source.parent._iterVars and source.parent._iterVars[source]
if keyNode then
vm.setNode(source, keyNode)
end