]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Fix recursive add docs strings from the comments
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 22 Apr 2017 22:00:11 +0000 (23:00 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 22 Apr 2017 22:00:11 +0000 (23:00 +0100)
src/libserver/cfg_rcl.c

index ae66570649b079fccc1396ac39b17b73784f6bc4..75b2229757a8368c8b8c9a5352199fda4fd3c529 100644 (file)
@@ -3883,9 +3883,17 @@ rspamd_rcl_add_doc_from_comments (struct rspamd_config *cfg,
                                                ucl_object_type (cur), NULL, 0, NULL, FALSE);
                        }
 
-                       if (cur_doc && ucl_object_type (cur) == UCL_OBJECT) {
-                               rspamd_rcl_add_doc_from_comments (cfg, cur_doc, cur, comments,
-                                               FALSE);
+                       if (ucl_object_type (cur) == UCL_OBJECT) {
+                               if (cur_doc) {
+                                       rspamd_rcl_add_doc_from_comments (cfg, cur_doc, cur,
+                                                       comments,
+                                                       FALSE);
+                               }
+                               else {
+                                       rspamd_rcl_add_doc_from_comments (cfg, top_doc, cur,
+                                                       comments,
+                                                       FALSE);
+                               }
                        }
                }
        }