From: Vsevolod Stakhov Date: Tue, 22 Oct 2019 16:58:10 +0000 (+0100) Subject: [Minor] Do not crash if redis cache cannot be reached X-Git-Tag: 2.1~42 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=0d916d0c7a636fcd72d80f73193d8543a1e6dcd3;p=rspamd.git [Minor] Do not crash if redis cache cannot be reached --- diff --git a/src/libstat/learn_cache/redis_cache.c b/src/libstat/learn_cache/redis_cache.c index a76ad585c..0df3783ab 100644 --- a/src/libstat/learn_cache/redis_cache.c +++ b/src/libstat/learn_cache/redis_cache.c @@ -470,7 +470,7 @@ rspamd_stat_cache_redis_learn (struct rspamd_task *task, gchar *h; gint flag; - if (rspamd_session_blocked (task->s)) { + if (rt == NULL || rt->ctx == NULL || rspamd_session_blocked (task->s)) { return RSPAMD_LEARN_INGORE; }