diff options
Diffstat (limited to 'mail/mail-format.c')
-rw-r--r-- | mail/mail-format.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/mail/mail-format.c b/mail/mail-format.c index a0b848a202..8ec33cd83c 100644 --- a/mail/mail-format.c +++ b/mail/mail-format.c @@ -666,13 +666,17 @@ format_mime_part (CamelMimePart *part, MailDisplay *md) MailMimeHandler *handler; gboolean output; int inline_flags; - + /* Record URLs associated with this part */ get_cid (part, md); get_location (part, md); - + wrapper = camel_medium_get_content_object (CAMEL_MEDIUM (part)); - + if (wrapper == NULL) { + g_warning ("mime part does not contain any data"); + return TRUE; + } + if (CAMEL_IS_MULTIPART (wrapper) && camel_multipart_get_number (CAMEL_MULTIPART (wrapper)) == 0) { char *mesg; @@ -688,7 +692,7 @@ format_mime_part (CamelMimePart *part, MailDisplay *md) mime_type = camel_data_wrapper_get_mime_type (wrapper); g_strdown (mime_type); - handler = mail_lookup_handler (mime_type); + handler = mime_type ? mail_lookup_handler (mime_type) : NULL; if (!handler) { char *id_type; @@ -697,7 +701,7 @@ format_mime_part (CamelMimePart *part, MailDisplay *md) * evil infinite recursion. */ - if (!strcmp (mime_type, "application/mac-binhex40")) { + if (mime_type && !strcmp (mime_type, "application/mac-binhex40")) { handler = NULL; } else { id_type = mail_identify_mime_part (part, md); |