]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Do not die when no metrics defined
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 14 Jul 2016 16:45:05 +0000 (17:45 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 14 Jul 2016 16:45:05 +0000 (17:45 +0100)
src/libserver/cfg_utils.c

index a38171475379941673fcafc2155262342854b046..709ce2adb9a7b4e92e6e65825f8984b58d1c1306 100644 (file)
@@ -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;
+                       }
                }
        }