From db1be26423ddb547fd29ce5d3de7ffa61fd3314f Mon Sep 17 00:00:00 2001 From: Not Zed Date: Mon, 31 Jan 2005 07:24:38 +0000 Subject: ** See bug #69850 2005-01-31 Not Zed ** See bug #69850 * mail-autofilter.c (rule_from_message): dont crash if we're missing the requested headers. svn path=/trunk/; revision=28622 --- mail/ChangeLog | 5 +++++ mail/mail-autofilter.c | 10 ++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/mail/ChangeLog b/mail/ChangeLog index d3e02d4c2f..56b3d6446e 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,5 +1,10 @@ 2005-01-31 Not Zed + ** See bug #69850 + + * mail-autofilter.c (rule_from_message): dont crash if we're + missing the requested headers. + ** See bug #71521. * em-account-editor.c (emae_url_set_hostport): dont ever set a diff --git a/mail/mail-autofilter.c b/mail/mail-autofilter.c index c660a03204..fe48b1777a 100644 --- a/mail/mail-autofilter.c +++ b/mail/mail-autofilter.c @@ -247,8 +247,8 @@ rule_from_message (FilterRule *rule, RuleContext *context, CamelMimeMessage *msg char *namestr; from = camel_mime_message_get_from (msg); - for (i = 0; camel_internet_address_get (from, i, &name, &addr); i++) { - rule_add_sender (context, rule, addr); + for (i = 0; from && camel_internet_address_get (from, i, &name, &addr); i++) { + rule_add_sender(context, rule, addr); if (name == NULL || name[0] == '\0') name = addr; namestr = g_strdup_printf(_("Mail from %s"), name); @@ -258,9 +258,11 @@ rule_from_message (FilterRule *rule, RuleContext *context, CamelMimeMessage *msg } if (flags & AUTO_TO) { addr = (CamelInternetAddress *)camel_mime_message_get_recipients (msg, CAMEL_RECIPIENT_TYPE_TO); - rule_match_recipients (context, rule, addr); + if (addr) + rule_match_recipients (context, rule, addr); addr = (CamelInternetAddress *)camel_mime_message_get_recipients (msg, CAMEL_RECIPIENT_TYPE_CC); - rule_match_recipients (context, rule, addr); + if (addr) + rule_match_recipients (context, rule, addr); } if (flags & AUTO_MLIST) { char *name, *mlist; -- cgit