aboutsummaryrefslogtreecommitdiffstats
path: root/src/lua/lua_task.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lua/lua_task.c')
-rw-r--r--src/lua/lua_task.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c
index d77d5b01d..068459922 100644
--- a/src/lua/lua_task.c
+++ b/src/lua/lua_task.c
@@ -5416,18 +5416,23 @@ lua_task_get_newlines_type (lua_State *L)
LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
- if (task && task->message) {
- switch (MESSAGE_FIELD (task, nlines_type)) {
- case RSPAMD_TASK_NEWLINES_CR:
- lua_pushstring (L, "cr");
- break;
- case RSPAMD_TASK_NEWLINES_LF:
- lua_pushstring (L, "lf");
- break;
- case RSPAMD_TASK_NEWLINES_CRLF:
- default:
+ if (task) {
+ if (task->message) {
+ switch (MESSAGE_FIELD (task, nlines_type)) {
+ case RSPAMD_TASK_NEWLINES_CR:
+ lua_pushstring (L, "cr");
+ break;
+ case RSPAMD_TASK_NEWLINES_LF:
+ lua_pushstring (L, "lf");
+ break;
+ case RSPAMD_TASK_NEWLINES_CRLF:
+ default:
+ lua_pushstring (L, "crlf");
+ break;
+ }
+ }
+ else {
lua_pushstring (L, "crlf");
- break;
}
}
else {