Skip to content

Commit 157b442

Browse files
committed
Added extra check to prevent undefined index error
1 parent 7f24ee8 commit 157b442

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/LuaTransformer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3142,7 +3142,7 @@ export class LuaTransformer {
31423142

31433143
const insideFunction = this.scopeStack.some(s => s.type === ScopeType.Function);
31443144
const isLetOrConst = tsOriginal && ts.isVariableDeclaration(tsOriginal)
3145-
&& (tsOriginal.parent.flags & (ts.NodeFlags.Let | ts.NodeFlags.Const)) !== 0;
3145+
&& tsOriginal.parent && (tsOriginal.parent.flags & (ts.NodeFlags.Let | ts.NodeFlags.Const)) !== 0;
31463146
if (this.isModule || this.currentNamespace || insideFunction || isLetOrConst) {
31473147
// local
31483148
const isFunction =

0 commit comments

Comments
 (0)