From: Vsevolod Stakhov Date: Thu, 14 Jul 2016 16:45:05 +0000 (+0100) Subject: [Fix] Do not die when no metrics defined X-Git-Tag: 1.3.0~80 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=73b36a82bf3a8c6ff0082bd2248239a449ce28e2;p=rspamd.git [Fix] Do not die when no metrics defined --- diff --git a/src/libserver/cfg_utils.c b/src/libserver/cfg_utils.c index a38171475..709ce2adb 100644 --- a/src/libserver/cfg_utils.c +++ b/src/libserver/cfg_utils.c @@ -1563,15 +1563,17 @@ rspamd_config_is_module_enabled (struct rspamd_config *cfg, } } - /* Now we check symbols group */ - gr = g_hash_table_lookup (metric->groups, module_name); - - if (gr) { - if (gr->disabled) { - msg_info_config ("%s module %s is disabled in the configuration as " - "its group has been disabled", - is_c ? "internal" : "lua", module_name); - return FALSE; + if (metric) { + /* Now we check symbols group */ + gr = g_hash_table_lookup (metric->groups, module_name); + + if (gr) { + if (gr->disabled) { + msg_info_config ("%s module %s is disabled in the configuration as " + "its group has been disabled", + is_c ? "internal" : "lua", module_name); + return FALSE; + } } }