]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
Oops, fix task:get_user
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 22 Feb 2016 23:25:29 +0000 (23:25 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 22 Feb 2016 23:25:29 +0000 (23:25 +0000)
src/lua/lua_task.c

index 3c28bb84f28de3296ca658fc2210c529e2f1be5c..dde8821041b11ced58880d2872d3e594509f7652 100644 (file)
@@ -1599,9 +1599,13 @@ lua_task_get_user (lua_State *L)
 {
        struct rspamd_task *task = lua_check_task (L, 1);
 
-       if (task && task->user != NULL) {
-               lua_pushstring (L, task->user);
-               return 1;
+       if (task) {
+               if (task->user != NULL) {
+                       lua_pushstring (L, task->user);
+               }
+               else {
+                       lua_pushnil (L);
+               }
        }
        else {
                luaL_error (L, "invalid arguments");