[geary/mjog/581-crash-forwarding-mail] Don't crash on GMime error in RFC822.Message.without_bcc



commit 1308fcba901f4e01bc76c7cb102055e44089c2b3
Author: Michael Gratton <mike vee net>
Date:   Sat Sep 28 21:36:32 2019 +1000

    Don't crash on GMime error in RFC822.Message.without_bcc
    
    Reporting an error is hardly useful on the SMTP delivery code path.
    
    Fixes crash in #581

 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]