From: Vsevolod Stakhov Date: Sun, 8 Dec 2019 09:39:59 +0000 (+0000) Subject: [Minor] Lua_task: Fix error handling for a task with no message X-Git-Tag: 2.3~237 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=b1b7c1f7fc99783236188645d39f2497559e1cf8;p=rspamd.git [Minor] Lua_task: Fix error handling for a task with no message --- diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c index 2354cb546..7072ebe35 100644 --- a/src/lua/lua_task.c +++ b/src/lua/lua_task.c @@ -2860,7 +2860,13 @@ lua_task_get_received_headers (lua_State * L) const gchar *proto; guint k = 1; - if (task && task->message) { + if (task) { + if (!task->message) { + /* No message - no received */ + lua_newtable (L); + return 1; + } + if (!lua_task_get_cached (L, task, "received")) { lua_createtable (L, 0, 0);