From eb06f94013a5674211d50f6dc4ae902075c29a11 Mon Sep 17 00:00:00 2001 From: mitchell Date: Sat, 6 Jun 2020 21:30:11 -0400 Subject: Fixed crash when LexerLPeg cannot find lexer.lua module. --- lexers/LexLPeg.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lexers/LexLPeg.cxx b/lexers/LexLPeg.cxx index a78189769..bf5b60774 100644 --- a/lexers/LexLPeg.cxx +++ b/lexers/LexLPeg.cxx @@ -479,6 +479,8 @@ class LexerLPeg : public DefaultLexer { if (status == LUA_OK && lua_pcall(L, 0, 1, -2) == LUA_OK) break; return (LogError(L), false); } + if (lua_isnil(L, -1)) + return (LogError(L, "'lexer.lua' module not found"), false); lua_remove(L, -2); // lua_error_handler lua_replace(L, -2); // nil lua_pushinteger(L, SC_FOLDLEVELBASE); -- cgit v1.2.3