summaryrefslogtreecommitdiffstats
path: root/src/lua/lua_text.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lua/lua_text.c')
-rw-r--r--src/lua/lua_text.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lua/lua_text.c b/src/lua/lua_text.c
index dde7e2c23..bec16c3b6 100644
--- a/src/lua/lua_text.c
+++ b/src/lua/lua_text.c
@@ -920,6 +920,10 @@ lua_text_split (lua_State *L)
struct rspamd_lua_regexp *re;
gboolean stringify = FALSE, own_re = FALSE;
+ if (t == NULL) {
+ return luaL_error (L, "invalid arguments");
+ }
+
if (lua_type (L, 2) == LUA_TUSERDATA) {
re = lua_check_regexp (L, 2);
}
@@ -947,7 +951,7 @@ lua_text_split (lua_State *L)
own_re = TRUE;
}
- if (t && re) {
+ if (re) {
if (lua_isboolean (L, 3)) {
stringify = lua_toboolean (L, 3);
}