diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-12-08 09:39:59 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-12-08 09:39:59 +0000 |
commit | b1b7c1f7fc99783236188645d39f2497559e1cf8 (patch) | |
tree | 01a3d3671c0d9c2e9c25821ce305c7d7b6f2b2b0 /src | |
parent | ba501e250fe5002b3d0c3831aafb438ee3687cdf (diff) | |
download | rspamd-b1b7c1f7fc99783236188645d39f2497559e1cf8.tar.gz rspamd-b1b7c1f7fc99783236188645d39f2497559e1cf8.zip |
[Minor] Lua_task: Fix error handling for a task with no message
Diffstat (limited to 'src')
-rw-r--r-- | src/lua/lua_task.c | 8 |
1 files changed, 7 insertions, 1 deletions
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); |