Skip to content

Commit 37e1e34

Browse files
committed
Sync with mlua-rs/luau
1 parent fbfdd28 commit 37e1e34

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

luau/Require/Runtime/src/RequireImpl.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ static bool isCached(lua_State* L, const std::string& key)
4343
static ResolvedRequire resolveRequire(luarequire_Configuration* lrc, lua_State* L, void* ctx, std::string path)
4444
{
4545
lua_Debug ar;
46-
lua_getinfo(L, 1, "s", &ar);
46+
if (!lua_getinfo(L, 1, "s", &ar))
47+
luaL_error(L, "require is not supported in this context");
4748

4849
if (!lrc->is_require_allowed(L, ctx, ar.source))
4950
luaL_error(L, "require is not supported in this context");

0 commit comments

Comments
 (0)