Code review fix in ModestAttachmentsView.
authorJose Dapena Paz <jdapena@igalia.com>
Sat, 5 Sep 2009 10:52:46 +0000 (12:52 +0200)
committerJose Dapena Paz <jdapena@igalia.com>
Tue, 13 Oct 2009 10:16:51 +0000 (12:16 +0200)
* src/widgets/modest-attachments-view.c (modest_attachments_view_set_message):
  don't assume msg_content_type != NULL doing an strcasecmp call
  (fix 1/2 NB#136381).

src/widgets/modest-attachments-view.c

index 8d498f3..e7d5a5c 100644 (file)
@@ -159,7 +159,7 @@ modest_attachments_view_set_message (ModestAttachmentsView *attachments_view, Tn
 
        part_to_check = modest_tny_msg_get_attachments_parent (TNY_MSG (msg));
        msg_content_type = modest_tny_mime_part_get_content_type (TNY_MIME_PART (part_to_check));
 
        part_to_check = modest_tny_msg_get_attachments_parent (TNY_MSG (msg));
        msg_content_type = modest_tny_mime_part_get_content_type (TNY_MIME_PART (part_to_check));
-       is_alternate = !strcasecmp (msg_content_type, "multipart/alternative");
+       is_alternate = (msg_content_type != NULL) && !strcasecmp (msg_content_type, "multipart/alternative");
 
        /* If the top mime part is a multipart/related, we don't show the attachments, as they're
         * embedded images in body */
 
        /* If the top mime part is a multipart/related, we don't show the attachments, as they're
         * embedded images in body */