aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2010-09-29 17:32:30 +0800
committerMilan Crha <mcrha@redhat.com>2010-09-29 17:32:30 +0800
commitc7b134377499a7bdc4a109cd1ec374ab5ac57a7b (patch)
tree942449ac114046e0c7ac0ee194edd569849fafe6 /mail
parent07bc66e30c07f6181c355b31e6d5e923e9541248 (diff)
downloadgsoc2013-evolution-c7b134377499a7bdc4a109cd1ec374ab5ac57a7b.tar
gsoc2013-evolution-c7b134377499a7bdc4a109cd1ec374ab5ac57a7b.tar.gz
gsoc2013-evolution-c7b134377499a7bdc4a109cd1ec374ab5ac57a7b.tar.bz2
gsoc2013-evolution-c7b134377499a7bdc4a109cd1ec374ab5ac57a7b.tar.lz
gsoc2013-evolution-c7b134377499a7bdc4a109cd1ec374ab5ac57a7b.tar.xz
gsoc2013-evolution-c7b134377499a7bdc4a109cd1ec374ab5ac57a7b.tar.zst
gsoc2013-evolution-c7b134377499a7bdc4a109cd1ec374ab5ac57a7b.zip
Bug #629799 - Crash importing a mail with an ics attachment
Diffstat (limited to 'mail')
-rw-r--r--mail/em-format-html-display.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/mail/em-format-html-display.c b/mail/em-format-html-display.c
index 3776d944ad..d3cb27a65c 100644
--- a/mail/em-format-html-display.c
+++ b/mail/em-format-html-display.c
@@ -807,24 +807,27 @@ efhd_attachment_button (EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObj
GtkWidget *widget;
gpointer parent;
EMFormat *emf = (EMFormat *) efh;
- CamelMessageInfo *mi = NULL;
guint32 size = 0;
/* FIXME: handle default shown case */
d(printf("adding attachment button/content\n"));
- mi = camel_folder_summary_uid (emf->folder->summary, emf->uid);
- if (mi) {
- const CamelMessageContentInfo *ci;
+ if (emf->folder && emf->folder->summary && emf->uid) {
+ CamelMessageInfo *mi;
- ci = camel_folder_summary_guess_content_info (mi, camel_mime_part_get_content_type (pobject->part));
- if (ci) {
- size = ci->size;
- /* what if its not encoded in base64 ? is it a case to consider? */
- if (ci->encoding && !g_ascii_strcasecmp (ci->encoding, "base64"))
- size = size/1.37;
+ mi = camel_folder_summary_uid (emf->folder->summary, emf->uid);
+ if (mi) {
+ const CamelMessageContentInfo *ci;
+
+ ci = camel_folder_summary_guess_content_info (mi, camel_mime_part_get_content_type (pobject->part));
+ if (ci) {
+ size = ci->size;
+ /* what if its not encoded in base64 ? is it a case to consider? */
+ if (ci->encoding && !g_ascii_strcasecmp (ci->encoding, "base64"))
+ size = size/1.37;
+ }
+ camel_message_info_free (mi);
}
- camel_message_info_free (mi);
}
info = (struct _attach_puri *)em_format_find_puri ((EMFormat *)efh, pobject->classid);