diff options
Diffstat (limited to 'mail/mail-tools.c')
-rw-r--r-- | mail/mail-tools.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/mail/mail-tools.c b/mail/mail-tools.c index 97433457a0..994879953b 100644 --- a/mail/mail-tools.c +++ b/mail/mail-tools.c @@ -396,27 +396,36 @@ mail_tool_forward_message (CamelMimeMessage *message) if (text) { gchar *ret_text, *credits = NULL; const CamelInternetAddress *cia; - const char *subject; - char *buf, *from, *to; + char *buf, *from, *to, *subject; /* create credits */ cia = camel_mime_message_get_from (message); buf = camel_address_format (CAMEL_ADDRESS (cia)); - from = e_text_to_html (buf, E_TEXT_TO_HTML_CONVERT_NL | E_TEXT_TO_HTML_CONVERT_URLS); - g_free (buf); + if (buf) { + from = e_text_to_html (buf, E_TEXT_TO_HTML_CONVERT_NL | E_TEXT_TO_HTML_CONVERT_URLS); + g_free (buf); + } else + from = NULL; cia = camel_mime_message_get_recipients (message, CAMEL_RECIPIENT_TYPE_TO); buf = camel_address_format (CAMEL_ADDRESS (cia)); - to = e_text_to_html (buf, E_TEXT_TO_HTML_CONVERT_NL | E_TEXT_TO_HTML_CONVERT_URLS); - g_free (buf); + if (buf) { + to = e_text_to_html (buf, E_TEXT_TO_HTML_CONVERT_NL | E_TEXT_TO_HTML_CONVERT_URLS); + g_free (buf); + } else + to = NULL; - subject = camel_mime_message_get_subject (message); + buf = (char *) camel_mime_message_get_subject (message); + if (buf) + subject = e_text_to_html (buf, E_TEXT_TO_HTML_CONVERT_NL | E_TEXT_TO_HTML_CONVERT_URLS); + else + subject = ""; credits = g_strdup_printf (_("-----Forwarded Message-----<br>" "<b>From:</b> %s<br>" "<b>To:</b> %s<br>" "<b>Subject:</b> %s<br>"), - from, to, subject); + from ? from : "", to ? to : "", subject); g_free (from); g_free (to); |