Fix crash on lovr.event.quit("restart")
@@ -511,7 +511,7 @@ void bridgeLovrUpdate(BridgeLovrUpdateData *updateData) {
luax_clearerror(T);
lovrSetErrorCallback(luax_vthrow, T);
if (lua_resume(T, 1) != LUA_YIELD) {
- if (lua_type(T, -1) == LUA_TSTRING && !strcmp(lua_tostring(T, -1), "restart")) {
+ if (lua_type(T, -2) == LUA_TSTRING && !strcmp(lua_tostring(T, -2), "restart")) {
state.renderCallback = NULL;
state.renderUserdata = NULL;
lua_close(L);
