diff --git a/src/celscript/lua/celx.cpp b/src/celscript/lua/celx.cpp index bce91d89f..b6ba66adc 100644 --- a/src/celscript/lua/celx.cpp +++ b/src/celscript/lua/celx.cpp @@ -266,6 +266,9 @@ static void checkTimeslice(lua_State* l, lua_Debug* /*ar*/) // allow the script to perform cleanup void LuaState::cleanup() { + if (!costate) + return; + if (ioMode == Asking) { // Restore renderflags: