From ca5d6d6a338fbe5d8e6b24b85f681b9df07ce392 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Thu, 16 Aug 2007 10:51:06 +0000 Subject: 2007-08-16 mcrha Part of fix for bug #350539 svn path=/trunk/; revision=34017 --- calendar/ChangeLog | 7 +++++++ calendar/gui/e-cal-popup.c | 5 ++++- composer/ChangeLog | 11 +++++++++++ composer/e-msg-composer-attachment-bar.c | 7 +++++-- composer/e-msg-composer-attachment.c | 2 +- composer/e-msg-composer.c | 17 ++++++++++++++++- mail/ChangeLog | 11 +++++++++++ mail/em-format-html.c | 11 +++++++++++ mail/em-format-quote.c | 8 +++++++- mail/em-format.c | 11 ++++++++++- mail/em-popup.c | 5 ++++- plugins/audio-inline/ChangeLog | 7 +++++++ plugins/audio-inline/audio-inline.c | 6 ++++-- plugins/mail-to-task/ChangeLog | 7 +++++++ plugins/mail-to-task/mail-to-task.c | 3 +++ plugins/prefer-plain/ChangeLog | 7 +++++++ plugins/prefer-plain/prefer-plain.c | 2 +- widgets/misc/ChangeLog | 9 +++++++++ widgets/misc/e-attachment-bar.c | 8 +++++++- widgets/misc/e-attachment.c | 2 +- 20 files changed, 133 insertions(+), 13 deletions(-) diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 68bc8a4c4d..889c9250f7 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,10 @@ +2007-08-16 Milan Crha + + ** Part of fix for bug #350539 + + * gui/e-cal-popup.c: (ecalp_part_popup_set_background): + Ensures non-NULL part. + 2007-08-16 Milan Crha ** Fix for bug #464106 diff --git a/calendar/gui/e-cal-popup.c b/calendar/gui/e-cal-popup.c index a5e4a0ed4a..f6ce2efe5f 100644 --- a/calendar/gui/e-cal-popup.c +++ b/calendar/gui/e-cal-popup.c @@ -210,7 +210,10 @@ ecalp_part_popup_set_background(EPopup *ep, EPopupItem *item, void *data) CamelMimePart *part = NULL; part = ((EAttachment *) ((ECalPopupTargetAttachments *) t)->attachments->data)->body; - + + if (!part) + return; + filename = g_strdup(camel_mime_part_get_filename(part)); /* if filename is blank, create a default filename based on MIME type */ diff --git a/composer/ChangeLog b/composer/ChangeLog index 284f2302a7..4710b653ab 100644 --- a/composer/ChangeLog +++ b/composer/ChangeLog @@ -1,3 +1,14 @@ +2007-08-16 Milan Crha + + ** Part of fix for bug #350539 + + * e-msg-composer-attachment.c: (e_msg_composer_attachment_edit): + * e-msg-composer-attachment-bar.c: (update), (attach_to_multipart): + * e-msg-composer.c: (add_attachments_handle_mime_part), + (handle_multipart_signed), (handle_multipart_alternative), + (handle_multipart): + Ensures non-NULL part. + 2007-08-10 Johnny Jacob * Modified and committed on behalf of Sankar P diff --git a/composer/e-msg-composer-attachment-bar.c b/composer/e-msg-composer-attachment-bar.c index 83a4545608..efc4776dff 100644 --- a/composer/e-msg-composer-attachment-bar.c +++ b/composer/e-msg-composer-attachment-bar.c @@ -230,7 +230,7 @@ update (EMsgComposerAttachmentBar *bar) attachment = p->data; - if (!attachment->is_available_local) { + if (!attachment->is_available_local || !attachment->body) { /* stock_attach would be better, but its fugly scaled up */ pixbuf = e_icon_factory_get_icon("stock_unknown", E_ICON_SIZE_DIALOG); if (pixbuf) { @@ -776,7 +776,10 @@ attach_to_multipart (CamelMultipart *multipart, { CamelContentType *content_type; CamelDataWrapper *content; - + + if (!attachment->body) + return; + content_type = camel_mime_part_get_content_type (attachment->body); content = camel_medium_get_content_object (CAMEL_MEDIUM (attachment->body)); diff --git a/composer/e-msg-composer-attachment.c b/composer/e-msg-composer-attachment.c index 295c9a26ad..e986d5106f 100644 --- a/composer/e-msg-composer-attachment.c +++ b/composer/e-msg-composer-attachment.c @@ -588,7 +588,7 @@ e_msg_composer_attachment_edit (EMsgComposerAttachment *attachment, GtkWidget *p dialog_data->disposition_checkbox = GTK_TOGGLE_BUTTON ( glade_xml_get_widget (editor_gui, "disposition_checkbox")); - if (attachment->is_available_local) { + if (attachment->is_available_local && attachment->body) { set_entry (editor_gui, "file_name_entry", camel_mime_part_get_filename (attachment->body)); set_entry (editor_gui, "description_entry", diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c index 0d569dcd9a..62db0ef7e7 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -4175,7 +4175,10 @@ add_attachments_handle_mime_part (EMsgComposer *composer, CamelMimePart *mime_pa { CamelContentType *content_type; CamelDataWrapper *wrapper; - + + if (!mime_part) + return; + content_type = camel_mime_part_get_content_type (mime_part); wrapper = camel_medium_get_content_object (CAMEL_MEDIUM (mime_part)); @@ -4262,6 +4265,10 @@ handle_multipart_signed (EMsgComposer *composer, CamelMultipart *multipart, int e_msg_composer_set_pgp_sign (composer, TRUE); mime_part = camel_multipart_get_part (multipart, CAMEL_MULTIPART_SIGNED_CONTENT); + + if (!mime_part) + return; + content_type = camel_mime_part_get_content_type (mime_part); content = camel_medium_get_content_object (CAMEL_MEDIUM (mime_part)); @@ -4374,6 +4381,10 @@ handle_multipart_alternative (EMsgComposer *composer, CamelMultipart *multipart, CamelMimePart *mime_part; mime_part = camel_multipart_get_part (multipart, i); + + if (!mime_part) + continue; + content_type = camel_mime_part_get_content_type (mime_part); content = camel_medium_get_content_object (CAMEL_MEDIUM (mime_part)); @@ -4428,6 +4439,10 @@ handle_multipart (EMsgComposer *composer, CamelMultipart *multipart, int depth) CamelMimePart *mime_part; mime_part = camel_multipart_get_part (multipart, i); + + if (!mime_part) + continue; + content_type = camel_mime_part_get_content_type (mime_part); content = camel_medium_get_content_object (CAMEL_MEDIUM (mime_part)); diff --git a/mail/ChangeLog b/mail/ChangeLog index ffdd76426a..19e5e6de00 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,14 @@ +2007-08-16 Milan Crha + + ** Part of fix for bug #350539 + + * em-format-quote.c: (emfq_format_headers), (emfq_text_plain): + * em-format.c: (emf_multipart_alternative), (emf_inlinepgp_signed): + * em-popup.c: (emp_part_popup_set_background): + * em-format-html.c: (efh_text_plain), (efh_message_external), + (efh_format_headers): + Ensures non-NULL part. + 2007-08-16 Srinivasa Ragavan ** Fix for bug #467198 diff --git a/mail/em-format-html.c b/mail/em-format-html.c index 2fbe9932c2..3ff8358853 100644 --- a/mail/em-format-html.c +++ b/mail/em-format-html.c @@ -775,6 +775,9 @@ efh_text_plain(EMFormatHTML *efh, CamelStream *stream, CamelMimePart *part, EMFo for (i=0;itext_html_flags; /* Check for RFC 2646 flowed text. */ diff --git a/mail/em-format.c b/mail/em-format.c index 40e2661706..7584f3301f 100644 --- a/mail/em-format.c +++ b/mail/em-format.c @@ -1243,6 +1243,10 @@ emf_multipart_alternative(EMFormat *emf, CamelStream *stream, CamelMimePart *par /* is it correct to use the passed in *part here? */ part = camel_multipart_get_part(mp, i); + + if (!part) + continue; + type = camel_mime_part_get_content_type (part); mime_type = camel_content_type_simple (type); @@ -1533,7 +1537,12 @@ emf_inlinepgp_signed(EMFormat *emf, CamelStream *stream, CamelMimePart *ipart, E CamelStream *ostream; CamelException *ex; char *type; - + + if (!ipart) { + em_format_format_error(emf, stream, _("Unknown error verifying signature")); + return; + } + ex = camel_exception_new(); cipher = camel_gpg_context_new(emf->session); /* Verify the signature of the message */ diff --git a/mail/em-popup.c b/mail/em-popup.c index f6f7372c40..bde562c939 100644 --- a/mail/em-popup.c +++ b/mail/em-popup.c @@ -435,7 +435,10 @@ emp_part_popup_set_background(EPopup *ep, EPopupItem *item, void *data) part = ((EAttachment *) ((EMPopupTargetAttachments *) t)->attachments->data)->body; else part = ((EMPopupTargetPart *) t)->part; - + + if (!part) + return; + filename = g_strdup(camel_mime_part_get_filename(part)); /* if filename is blank, create a default filename based on MIME type */ diff --git a/plugins/audio-inline/ChangeLog b/plugins/audio-inline/ChangeLog index 98a3dbbc8f..9236ac4af8 100644 --- a/plugins/audio-inline/ChangeLog +++ b/plugins/audio-inline/ChangeLog @@ -1,3 +1,10 @@ +2007-08-16 Milan Crha + + ** Part of fix for bug #350539 + + * audio-inline.c: (org_gnome_audio_inline_play_clicked): + Ensures non-NULL part. + 2006-01-09 Kjartan Maraas * audio-inline.c: (org_gnome_audio_inline_add_button): diff --git a/plugins/audio-inline/audio-inline.c b/plugins/audio-inline/audio-inline.c index dd9621ce6b..615e06446c 100644 --- a/plugins/audio-inline/audio-inline.c +++ b/plugins/audio-inline/audio-inline.c @@ -214,14 +214,16 @@ org_gnome_audio_inline_play_clicked (GtkWidget *button, EMFormatHTMLPObject *pob d(printf ("audio inline formatter: init gst thread\n")); if (gst_init_check (&argc, (char ***) &argv)) { - CamelContentType *type; + CamelContentType *type = NULL; GstElement *filesrc; /* create a disk reader */ filesrc = gst_element_factory_make ("filesrc", "disk_source"); g_object_set (G_OBJECT (filesrc), "location", po->filename, NULL); - type = camel_mime_part_get_content_type (po->part); + if (po->part) + type = camel_mime_part_get_content_type (po->part); + if (type) { if (!g_ascii_strcasecmp (type->type, "audio")) { if (!g_ascii_strcasecmp (type->subtype, "mpeg") || !g_ascii_strcasecmp (type->subtype, "x-mpeg") diff --git a/plugins/mail-to-task/ChangeLog b/plugins/mail-to-task/ChangeLog index 35727aa4b1..c811d9dc7e 100644 --- a/plugins/mail-to-task/ChangeLog +++ b/plugins/mail-to-task/ChangeLog @@ -1,3 +1,10 @@ +2007-08-16 Milan Crha + + ** Part of fix for bug #350539 + + * mail-to-task.c: (set_description): + Ensures non-NULL mime_part. + 2007-04-02 Sankar P * Committed on behalf of Gilles Dartiguelongue diff --git a/plugins/mail-to-task/mail-to-task.c b/plugins/mail-to-task/mail-to-task.c index 9b3d18e7fd..0cddb62bf2 100644 --- a/plugins/mail-to-task/mail-to-task.c +++ b/plugins/mail-to-task/mail-to-task.c @@ -131,6 +131,9 @@ set_description (ECalComponent *comp, CamelMimeMessage *message) count--; } + if (!mime_part) + return; + type = camel_mime_part_get_content_type (mime_part); if (!camel_content_type_is (type, "text", "plain")) return; diff --git a/plugins/prefer-plain/ChangeLog b/plugins/prefer-plain/ChangeLog index da61ef43d7..3c16d88af2 100644 --- a/plugins/prefer-plain/ChangeLog +++ b/plugins/prefer-plain/ChangeLog @@ -1,3 +1,10 @@ +2007-08-16 Milan Crha + + ** Part of fix for bug #350539 + + * prefer-plain.c: (org_gnome_prefer_plain_multipart_alternative): + Ensures non-NULL part. + 2007-08-05 Johnny Jacob * Committed on behalf of Anand V M diff --git a/plugins/prefer-plain/prefer-plain.c b/plugins/prefer-plain/prefer-plain.c index 515645bbad..7d967db839 100644 --- a/plugins/prefer-plain/prefer-plain.c +++ b/plugins/prefer-plain/prefer-plain.c @@ -66,7 +66,7 @@ org_gnome_prefer_plain_multipart_alternative(void *ep, EMFormatHookTarget *t) nparts = camel_multipart_get_number(mp); for (i=0; i + + ** Part of fix for bug #350539 + + * e-attachment.c: (e_attachment_edit): + * e-attachment-bar.c: (e_attachment_bar_create_attachment_cache), + (update), (attach_to_multipart): + Ensures non-NULL part. + 2007-08-06 Srinivasa Ragavan ** Fix for bug #429234 diff --git a/widgets/misc/e-attachment-bar.c b/widgets/misc/e-attachment-bar.c index ce1268ce1c..f733d4dbad 100644 --- a/widgets/misc/e-attachment-bar.c +++ b/widgets/misc/e-attachment-bar.c @@ -194,6 +194,9 @@ e_attachment_bar_create_attachment_cache (EAttachment *attachment) CamelContentType *content_type; + if (!attachment->body) + return; + content_type = camel_mime_part_get_content_type (attachment->body); if (camel_content_type_is(content_type, "image", "*")) { @@ -277,7 +280,7 @@ update (EAttachmentBar *bar) attachment = priv->attachments->pdata[i]; - if (!attachment->is_available_local) { + if (!attachment->is_available_local || !attachment->body) { /* stock_attach would be better, but its fugly scaled up */ if ((pixbuf = e_icon_factory_get_icon("stock_unknown", E_ICON_SIZE_DIALOG))) { attachment->index = gnome_icon_list_append_pixbuf (icon_list, pixbuf, NULL, ""); @@ -1070,6 +1073,9 @@ attach_to_multipart (CamelMultipart *multipart, CamelContentType *content_type; CamelDataWrapper *content; + if (!attachment->body) + return; + content_type = camel_mime_part_get_content_type (attachment->body); content = camel_medium_get_content_object (CAMEL_MEDIUM (attachment->body)); diff --git a/widgets/misc/e-attachment.c b/widgets/misc/e-attachment.c index 19503c5ea9..1019dab1c6 100644 --- a/widgets/misc/e-attachment.c +++ b/widgets/misc/e-attachment.c @@ -700,7 +700,7 @@ e_attachment_edit (EAttachment *attachment, GtkWidget *parent) dialog_data->mime_type_entry = GTK_ENTRY (glade_xml_get_widget (editor_gui, "mime_type_entry")); dialog_data->disposition_checkbox = GTK_TOGGLE_BUTTON (glade_xml_get_widget (editor_gui, "disposition_checkbox")); - if (attachment->is_available_local) { + if (attachment->is_available_local && attachment->body) { set_entry (editor_gui, "file_name_entry", camel_mime_part_get_filename (attachment->body)); set_entry (editor_gui, "description_entry", camel_mime_part_get_description (attachment->body)); content_type = camel_mime_part_get_content_type (attachment->body); -- cgit v1.2.3