[geary/cherry-pick-6ddbf039] Merge branch 'mjog/581-crash-forwarding-mail' into 'mainline'



commit 3fe3c83887c6b0225726a775a93b9f15b71f6deb
Author: Michael Gratton <mike vee net>
Date:   Sat Sep 28 12:33:24 2019 +0000

    Merge branch 'mjog/581-crash-forwarding-mail' into 'mainline'
    
    Don't crash on GMime error in RFC822.Message.without_bcc
    
    See merge request GNOME/geary!319
    
    (cherry picked from commit 6ddbf039a8362c098461d275b50c8a192ba2792c)
    
    1308fcba Don't crash on GMime error in RFC822.Message.without_bcc

 src/engine/rfc822/rfc822-message.vala | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
---
diff --git a/src/engine/rfc822/rfc822-message.vala b/src/engine/rfc822/rfc822-message.vala
index f600c929..834ed98c 100644
--- a/src/engine/rfc822/rfc822-message.vala
+++ b/src/engine/rfc822/rfc822-message.vala
@@ -371,7 +371,7 @@ public class Geary.RFC822.Message : BaseObject, EmailHeaderSet {
 
     // Makes a copy of the given message without the BCC fields. This is used for sending the email
     // without sending the BCC headers to all recipients.
-    public Message.without_bcc(Message email) {
+    public Message.without_bcc(Message email) throws GLib.Error {
         // GMime doesn't make it easy to get a copy of the body of a message.  It's easy to
         // make a new message and add in all the headers, but calling set_mime_part() with
         // the existing one's get_mime_part() result yields a double Content-Type header in
@@ -379,11 +379,7 @@ public class Geary.RFC822.Message : BaseObject, EmailHeaderSet {
         // Barring any better way to clone a message, which I couldn't find by looking at
         // the docs, we just dump out the old message to a buffer and read it back in to
         // create the new object.  Kinda sucks, but our hands are tied.
-        try {
-            this.from_buffer (email.message_to_memory_buffer(false, false));
-        } catch (Error e) {
-            error("Error creating a memory buffer from a message: %s", e.message);
-        }
+        this.from_buffer(email.message_to_memory_buffer(false, false));
 
         // GMime also drops the ball for the *new* message.  When it comes out of the GMime
         // Parser, its "mime part" somehow isn't realizing it has a Content-Type header


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]