mirror of
https://github.com/minetest/minetest.git
synced 2024-11-29 19:13:44 +01:00
Fix crash in log_deprecated when triggered from no function
Based on commit a1598e1b
This commit is contained in:
parent
119aa5c919
commit
2515207606
@ -181,7 +181,9 @@ void log_deprecated(lua_State *L, const std::string &message)
|
||||
warningstream << message;
|
||||
if (L) { // L can be NULL if we get called from scripting_game.cpp
|
||||
lua_Debug ar;
|
||||
FATAL_ERROR_IF(!lua_getstack(L, 2, &ar), "lua_getstack() failed");
|
||||
|
||||
if (!lua_getstack(L, 2, &ar))
|
||||
FATAL_ERROR_IF(!lua_getstack(L, 1, &ar), "lua_getstack() failed");
|
||||
FATAL_ERROR_IF(!lua_getinfo(L, "Sl", &ar), "lua_getinfo() failed");
|
||||
warningstream << " (at " << ar.short_src << ":" << ar.currentline << ")";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user