aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mail/em-format-html-display.c25
-rw-r--r--plugins/itip-formatter/itip-formatter.c12
2 files changed, 21 insertions, 16 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);
diff --git a/plugins/itip-formatter/itip-formatter.c b/plugins/itip-formatter/itip-formatter.c
index db2b5d0c85..2a71ce3707 100644
--- a/plugins/itip-formatter/itip-formatter.c
+++ b/plugins/itip-formatter/itip-formatter.c
@@ -231,7 +231,7 @@ find_to_address (struct _itip_puri *pitip, icalcomponent *ical_comp, icalparamet
it = e_list_get_iterator ((EList *)pitip->accounts);
- if (!pitip->to_address && pitip->msg) {
+ if (!pitip->to_address && pitip->msg && pitip->folder) {
EAccount *account = em_utils_guess_account (pitip->msg, pitip->folder);
if (account) {
@@ -822,6 +822,8 @@ find_server (struct _itip_puri *pitip, ECalComponent *comp)
gchar *uri;
ESource *source = NULL, *current_source = NULL;
+ g_return_if_fail (pitip->folder != NULL);
+
e_cal_component_get_uid (comp, &uid);
rid = e_cal_component_get_recurid_as_string (comp);
@@ -1973,7 +1975,7 @@ view_response_cb (GtkWidget *widget, ItipViewResponse response, gpointer data)
}
/* FIXME Remove this and handle this at the groupwise mail provider */
- if (delete_invitation_from_cache) {
+ if (delete_invitation_from_cache && pitip->folder) {
CamelFolderChangeInfo *changes = NULL;
const gchar *tag = NULL;
CamelMessageInfo *mi;
@@ -2025,7 +2027,7 @@ view_response_cb (GtkWidget *widget, ItipViewResponse response, gpointer data)
}
}
- if (!save_schedules && pitip->delete_message)
+ if (!save_schedules && pitip->delete_message && pitip->folder)
camel_folder_delete_message (pitip->folder, pitip->uid);
if (itip_view_get_rsvp (ITIP_VIEW (pitip->view)) && status) {
@@ -2095,7 +2097,7 @@ view_response_cb (GtkWidget *widget, ItipViewResponse response, gpointer data)
}
e_cal_component_rescan (comp);
- if (itip_send_comp (E_CAL_COMPONENT_METHOD_REPLY, comp, pitip->current_ecal, pitip->top_level, NULL, NULL, TRUE, FALSE)) {
+ if (itip_send_comp (E_CAL_COMPONENT_METHOD_REPLY, comp, pitip->current_ecal, pitip->top_level, NULL, NULL, TRUE, FALSE) && pitip->folder) {
camel_folder_set_message_flags (
pitip->folder, pitip->uid,
CAMEL_MESSAGE_ANSWERED,
@@ -2134,7 +2136,7 @@ in_proper_folder (CamelFolder *folder)
gchar *uri;
if (!folder)
- return res;
+ return FALSE;
uri = mail_tools_folder_to_url (folder);