]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Check language detector prior to usage
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 7 Sep 2018 21:40:33 +0000 (22:40 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 7 Sep 2018 21:40:33 +0000 (22:40 +0100)
src/libmime/message.c

index 2a0981ecdd26731b4e059a1be943e4faa7777685..70a08a06ff55a5822cd79cbde7f0f2b513c7620b 100644 (file)
@@ -223,7 +223,7 @@ rspamd_mime_part_detect_language (struct rspamd_task *task,
 {
        struct rspamd_lang_detector_res *lang;
 
-       if (part->utf_words) {
+       if (part->utf_words && task->lang_det) {
                if (rspamd_language_detector_detect (task, task->lang_det, part)) {
                        lang = g_ptr_array_index (part->languages, 0);
                        part->language = lang->lang;