mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Auth API: Error when accessed prior to ServerEnv init (#11398)
This commit is contained in:
parent
827a7852e2
commit
062fd2190e
1 changed files with 4 additions and 1 deletions
|
@ -32,8 +32,11 @@ AuthDatabase *ModApiAuth::getAuthDb(lua_State *L)
|
|||
{
|
||||
ServerEnvironment *server_environment =
|
||||
dynamic_cast<ServerEnvironment *>(getEnv(L));
|
||||
if (!server_environment)
|
||||
if (!server_environment) {
|
||||
luaL_error(L, "Attempt to access an auth function but the auth"
|
||||
" system is yet not initialized. This causes bugs.");
|
||||
return nullptr;
|
||||
}
|
||||
return server_environment->getAuthDatabase();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue