aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-12-06 18:01:02 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-12-06 18:01:02 +0000
commit2b3d75925a9cc6a79ba75ae0d5aa9909e205a086 (patch)
treefb6103d27f52498b3e52751419561f442dbfd436 /src
parenta3f2acd3f7388425bfc486234b9c1ca066a62f1a (diff)
downloadrspamd-2b3d75925a9cc6a79ba75ae0d5aa9909e205a086.tar.gz
rspamd-2b3d75925a9cc6a79ba75ae0d5aa9909e205a086.zip
[Minor] Check if we have a current item
Diffstat (limited to 'src')
-rw-r--r--src/lua/lua_spf.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lua/lua_spf.c b/src/lua/lua_spf.c
index 668c5ab58..e3c0686b7 100644
--- a/src/lua/lua_spf.c
+++ b/src/lua/lua_spf.c
@@ -228,7 +228,10 @@ lua_spf_resolve (lua_State * L)
/* TODO: make it as an optional parameter */
spf_cred = rspamd_spf_get_cred (task);
cbd->item = rspamd_symcache_get_cur_item (task);
- rspamd_symcache_item_async_inc (task, cbd->item, "lua_spf");
+
+ if (cbd->item) {
+ rspamd_symcache_item_async_inc (task, cbd->item, "lua_spf");
+ }
REF_INIT_RETAIN (cbd, lua_spf_dtor);
if (!rspamd_spf_resolve (task, spf_lua_lib_callback, cbd, spf_cred)) {