From: Vsevolod Stakhov Date: Mon, 22 Feb 2016 23:25:29 +0000 (+0000) Subject: Oops, fix task:get_user X-Git-Tag: 1.2.0~184 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2b0e6f4d0e0582006c172867df93121755201e66;p=thirdparty%2Frspamd.git Oops, fix task:get_user --- diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c index 3c28bb84f2..dde8821041 100644 --- a/src/lua/lua_task.c +++ b/src/lua/lua_task.c @@ -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");