From: Alberto Garcia Date: Fri, 14 Mar 2008 09:34:23 +0000 (+0000) Subject: * src/modest-tny-msg.c X-Git-Tag: git_migration_finished~1560 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=b978d07da0770b94bb6c49c25a8f528022af94e8;ds=sidebyside * src/modest-tny-msg.c (modest_tny_msg_find_body_part_from_mime_part): Check for NULL values of Content-Type, avoids a Gtk Warning pmo-trunk-r4308 --- diff --git a/src/modest-tny-msg.c b/src/modest-tny-msg.c index 0fe400c..8680c82 100644 --- a/src/modest-tny-msg.c +++ b/src/modest-tny-msg.c @@ -398,7 +398,7 @@ modest_tny_msg_find_body_part_from_mime_part (TnyMimePart *msg, gboolean want_ht TnyList *parts = NULL; TnyIterator *iter = NULL; gchar *header_content_type; - gchar *header_content_type_lower; + gchar *header_content_type_lower = NULL; if (!msg) return NULL; @@ -406,8 +406,10 @@ modest_tny_msg_find_body_part_from_mime_part (TnyMimePart *msg, gboolean want_ht /* If it's an application multipart, then we don't get into as we don't * support them (for example application/sml or wap messages */ header_content_type = modest_tny_mime_part_get_header_value (msg, "Content-Type"); - header_content_type = g_strstrip (header_content_type); - header_content_type_lower = header_content_type?g_ascii_strdown (header_content_type, -1):NULL; + if (header_content_type) { + header_content_type = g_strstrip (header_content_type); + header_content_type_lower = g_ascii_strdown (header_content_type, -1); + } if (header_content_type_lower && g_str_has_prefix (header_content_type_lower, "multipart/") && !g_str_has_prefix (header_content_type_lower, "multipart/signed") &&