Fixes a crash when the message comes without a content type
authorSergio Villar Senin <svillar@igalia.com>
Wed, 17 Dec 2008 11:11:19 +0000 (11:11 +0000)
committerSergio Villar Senin <svillar@igalia.com>
Wed, 17 Dec 2008 11:11:19 +0000 (11:11 +0000)
pmo-trunk-r6909

src/modest-tny-mime-part.c

index e438f34..bd66d02 100644 (file)
@@ -217,6 +217,10 @@ modest_tny_mime_part_get_headers_content_type (TnyMimePart *part)
        g_return_val_if_fail (TNY_IS_MIME_PART (part), NULL);
 
        header_content_type = modest_tny_mime_part_get_header_value (part, "Content-Type");
+
+       if (!header_content_type)
+               return NULL;
+
        header_content_type = g_strstrip (header_content_type);
 
        /* remove the ; suffix */