summaryrefslogtreecommitdiffstats
path: root/src/lua/lua_common.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-11-25 13:26:34 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-11-25 13:26:34 +0000
commit074033b9aa59529eac839513b982505e6adef7f5 (patch)
treeca193c994d6fbe264f7763850895171486bd182b /src/lua/lua_common.c
parent82d8d983b1f1a2f53daea13325690651086f2c82 (diff)
downloadrspamd-074033b9aa59529eac839513b982505e6adef7f5.tar.gz
rspamd-074033b9aa59529eac839513b982505e6adef7f5.zip
[Project] Various fixes for lua_content project
Diffstat (limited to 'src/lua/lua_common.c')
-rw-r--r--src/lua/lua_common.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/lua/lua_common.c b/src/lua/lua_common.c
index 2e34c42dd..45ca2c97e 100644
--- a/src/lua/lua_common.c
+++ b/src/lua/lua_common.c
@@ -1829,8 +1829,14 @@ rspamd_lua_get_traceback_string (lua_State *L, luaL_Buffer *buf)
{
const gchar *msg = lua_tostring (L, -1);
- luaL_addstring (buf, msg);
- lua_pop (L, 1); /* Error string */
+ if (msg) {
+ luaL_addstring (buf, msg);
+ lua_pop (L, 1); /* Error string */
+ }
+ else {
+ luaL_addstring (buf, "unknown error");
+ }
+
luaL_addstring (buf, "; trace:");
rspamd_lua_traceback_string (L, buf);
}