diff options
author | Not Zed <NotZed@Ximian.com> | 2005-01-31 15:24:38 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2005-01-31 15:24:38 +0800 |
commit | db1be26423ddb547fd29ce5d3de7ffa61fd3314f (patch) | |
tree | 534b1d66441f739b9c9d7399bc58b70377ccbe04 /mail/mail-autofilter.c | |
parent | 3a69dc3b8f569e829e7965cb095b29c4a61f67c0 (diff) | |
download | gsoc2013-evolution-db1be26423ddb547fd29ce5d3de7ffa61fd3314f.tar.gz gsoc2013-evolution-db1be26423ddb547fd29ce5d3de7ffa61fd3314f.tar.zst gsoc2013-evolution-db1be26423ddb547fd29ce5d3de7ffa61fd3314f.zip |
** See bug #69850
2005-01-31 Not Zed <NotZed@Ximian.com>
** See bug #69850
* mail-autofilter.c (rule_from_message): dont crash if we're
missing the requested headers.
svn path=/trunk/; revision=28622
Diffstat (limited to 'mail/mail-autofilter.c')
-rw-r--r-- | mail/mail-autofilter.c | 10 |
1 files changed, 6 insertions, 4 deletions
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; |