From b2f1b4ff38862045dc318413a2d179554a494b99 Mon Sep 17 00:00:00 2001 From: Vivek Jain Date: Mon, 8 Aug 2005 07:05:19 +0000 Subject: check part before using it, else dump source 2005-08-08 Vivek Jain * em-format.c: (emf_multipart_appledouble): check part before using it, else dump source svn path=/trunk/; revision=30031 --- mail/em-format.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'mail/em-format.c') diff --git a/mail/em-format.c b/mail/em-format.c index 10965148c0..61bd9551b6 100644 --- a/mail/em-format.c +++ b/mail/em-format.c @@ -1160,6 +1160,7 @@ static void emf_multipart_appledouble(EMFormat *emf, CamelStream *stream, CamelMimePart *part, const EMFormatHandler *info) { CamelMultipart *mp = (CamelMultipart *)camel_medium_get_content_object((CamelMedium *)part); + CamelMimePart *mime_part; int len; if (!CAMEL_IS_MULTIPART(mp)) { @@ -1167,11 +1168,16 @@ emf_multipart_appledouble(EMFormat *emf, CamelStream *stream, CamelMimePart *par return; } - /* try the data fork for something useful, doubtful but who knows */ - len = emf->part_id->len; - g_string_append_printf(emf->part_id, ".appledouble.1"); - em_format_part(emf, stream, camel_multipart_get_part(mp, 1)); - g_string_truncate(emf->part_id, len); + mime_part = camel_multipart_get_part(mp, 1); + if (mime_part) { + /* try the data fork for something useful, doubtful but who knows */ + len = emf->part_id->len; + g_string_append_printf(emf->part_id, ".appledouble.1"); + em_format_part(emf, stream, mime_part); + g_string_truncate(emf->part_id, len); + } else + em_format_format_source(emf, stream, part); + } /* RFC ??? */ -- cgit v1.2.3