Add check for return value for luaL_newstate
This commit is contained in:
parent
025cce6012
commit
50311128c7
|
@ -1033,6 +1033,13 @@ void init_lua_jit() {
|
|||
if (lua_hooks_enabled) {
|
||||
lua_state = luaL_newstate();
|
||||
|
||||
if (lua_state == NULL) {
|
||||
logger << log4cpp::Priority::ERROR << "Can't create LUA session";
|
||||
|
||||
lua_hooks_enabled = false;
|
||||
return;
|
||||
}
|
||||
|
||||
// load libraries
|
||||
luaL_openlibs(lua_state);
|
||||
|
||||
|
|
Loading…
Reference in New Issue