From 4d993e1eaaca9cfa1c860aadb75caf8a9df5860d Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 21 May 2018 16:40:27 +0300 Subject: crash fix: MirLua crashes inside Options - Plugins if the plugin is disabled --- libs/liblua/src/lstate.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libs/liblua/src') diff --git a/libs/liblua/src/lstate.c b/libs/liblua/src/lstate.c index 11299d3743..0c056f9041 100644 --- a/libs/liblua/src/lstate.c +++ b/libs/liblua/src/lstate.c @@ -339,6 +339,9 @@ LUA_API lua_State *lua_newstate (lua_Alloc f, void *ud) { LUA_API void lua_close (lua_State *L) { + if (!L) + return; + L = G(L)->mainthread; /* only the main thread can be closed */ lua_lock(L); close_state(L); -- cgit v1.2.3