]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Lua_task: Fix error handling for a task with no message
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 8 Dec 2019 09:39:59 +0000 (09:39 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 8 Dec 2019 09:39:59 +0000 (09:39 +0000)
src/lua/lua_task.c

index 2354cb546dd4c3613bd2a471b4f76251dd7cb54a..7072ebe35ed62abc43cc84105142a9bc8e131904 100644 (file)
@@ -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);