Skip to content

Commit 32ed3fb

Browse files
committed
fixed incorrect env being accessed sometimes
1 parent ac426b4 commit 32ed3fb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

debugger/luafuncs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export function loadLuaFile(
101101
}
102102

103103
export function luaGetEnv(level: number, thread?: LuaThread): Env | undefined {
104-
const info = thread ? debug.getinfo(thread, level, "f") : debug.getinfo(level + 1, "f");
104+
const info = thread && debug.getinfo(thread, level, "f") || debug.getinfo(level + 1, "f");
105105
if (!info || !info.func) {
106106
return;
107107
}

0 commit comments

Comments
 (0)