{
/* Start lua post handler */
lua_State *L = session->ctx->cfg->lua_state;
- int err_idx, ret, nargs = 9;
+ int err_idx, ret, nargs = 10;
lua_pushcfunction(L, &rspamd_lua_traceback);
err_idx = lua_gettop(L);
/* We push shingles merely for commands that modify content to avoid extra work */
if (is_shingle && cmd->cmd != FUZZY_CHECK) {
lua_newshingle(L, &session->cmd.sgl);
- nargs++;
+ } else {
+ lua_pushnil(L);
}
if ((ret = lua_pcall(L, nargs, LUA_MULTRET, err_idx)) != 0) {
{
/* Start lua pre handler */
lua_State *L = session->ctx->cfg->lua_state;
- int err_idx, ret, nargs = 7;
+ int err_idx, ret, nargs = 8;
lua_pushcfunction(L, &rspamd_lua_traceback);
err_idx = lua_gettop(L);
/* We push shingles merely for commands that modify content to avoid extra work */
if (is_shingle && cmd->cmd != FUZZY_CHECK) {
lua_newshingle(L, &session->cmd.sgl);
- nargs++;
+ } else {
+ lua_pushnil(L);
}
/* Flag and value */