aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/lua/lua_task.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c
index 3c28bb84f..dde882104 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");