From de8246dc8a906807234cab134e100abf64f2b1e0 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Wed, 18 Oct 2000 01:09:45 +0000 Subject: If the body text was NULL, then don't bother turning it into HTML 2000-10-17 Jeffrey Stedfast * e-msg-composer.c (e_msg_composer_new_with_message): If the body text was NULL, then don't bother turning it into HTML (besides, it causes a nasty segfault). svn path=/trunk/; revision=5971 --- composer/ChangeLog | 6 ++++++ composer/e-msg-composer.c | 21 +++++++++++---------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/composer/ChangeLog b/composer/ChangeLog index 670e2eb9c8..609d741da3 100644 --- a/composer/ChangeLog +++ b/composer/ChangeLog @@ -1,3 +1,9 @@ +2000-10-17 Jeffrey Stedfast + + * e-msg-composer.c (e_msg_composer_new_with_message): If the body + text was NULL, then don't bother turning it into HTML (besides, it + causes a nasty segfault). + 2000-10-15 Dan Winship * Makefile.am: Move CPPFLAGS flags to INCLUDES to avoid bashing diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c index 71a343b359..e05dc71103 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -1445,17 +1445,18 @@ e_msg_composer_new_with_message (CamelMimeMessage *msg) contents = camel_medium_get_content_object (CAMEL_MEDIUM (msg)); text = mail_get_message_body (contents, FALSE, &is_html); - if (is_html) - final_text = g_strdup (text); - else - final_text = e_text_to_html (text, E_TEXT_TO_HTML_CONVERT_NL | - E_TEXT_TO_HTML_CONVERT_SPACES); - g_free (text); - - e_msg_composer_set_body_text (new, final_text); + if (text) { + if (is_html) + final_text = g_strdup (text); + else + final_text = e_text_to_html (text, E_TEXT_TO_HTML_CONVERT_NL | + E_TEXT_TO_HTML_CONVERT_SPACES); + g_free (text); + + e_msg_composer_set_body_text (new, final_text); + } - /*set_editor_text (BONOBO_WIDGET (new->editor), - NULL, "FIXME: like, uh... put the message here and stuff\n");*/ + /* FIXME: attach the message attachments */ return new; } -- cgit v1.2.3