aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-07-20 00:23:17 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-07-20 00:39:58 +0800
commit8a0bb568238483e65ba0e053ddca0e47fb01040f (patch)
tree6f3fc5c3cd944cc0d37070e8e72f024b4614cdde
parent524a5dd1a87d82531fac0a8624ba11abd5a9b0b7 (diff)
downloadgsoc2013-evolution-8a0bb568238483e65ba0e053ddca0e47fb01040f.tar
gsoc2013-evolution-8a0bb568238483e65ba0e053ddca0e47fb01040f.tar.gz
gsoc2013-evolution-8a0bb568238483e65ba0e053ddca0e47fb01040f.tar.bz2
gsoc2013-evolution-8a0bb568238483e65ba0e053ddca0e47fb01040f.tar.lz
gsoc2013-evolution-8a0bb568238483e65ba0e053ddca0e47fb01040f.tar.xz
gsoc2013-evolution-8a0bb568238483e65ba0e053ddca0e47fb01040f.tar.zst
gsoc2013-evolution-8a0bb568238483e65ba0e053ddca0e47fb01040f.zip
EMailRequest: Handle empty message bodies more gracefully.
-rw-r--r--mail/e-mail-request.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/mail/e-mail-request.c b/mail/e-mail-request.c
index 892065c8d2..cf04abfc09 100644
--- a/mail/e-mail-request.c
+++ b/mail/e-mail-request.c
@@ -184,9 +184,14 @@ handle_mail_request (GSimpleAsyncResult *res,
context.part_list = NULL;
/* Convert the GString to GInputStream and send it back to WebKit */
- ba = camel_stream_mem_get_byte_array (CAMEL_STREAM_MEM (request->priv->output_stream));
- if (!ba->data) {
- gchar *data = g_strdup_printf (_("Failed to load part '%s'"), part_id);
+ ba = camel_stream_mem_get_byte_array (
+ CAMEL_STREAM_MEM (request->priv->output_stream));
+ if (ba->data == NULL) {
+ gchar *data;
+
+ data = g_strdup_printf (
+ "<p align='center'>%s</p>",
+ _("The message has no text content."));
dd (printf ("%s", data));
g_byte_array_append (ba, (guchar *) data, strlen (data));
g_free (data);