[evolution] mail-reader: e_mail_reader_get_formatter may now return NULL



commit 3696034171889e067b7c9b9e118b9746c1986bcf
Author: Rob Bradford <rob linux intel com>
Date:   Mon Aug 2 15:09:27 2010 +0100

    mail-reader: e_mail_reader_get_formatter may now return NULL
    
    Since e_mail_reader_get_formatter (the EMailNotebookView implementation) can
    now return NULL we need to prevent that being passed into other functions.
    
    Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=624867

 mail/e-mail-reader.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c
index ff6245e..3d4378b 100644
--- a/mail/e-mail-reader.c
+++ b/mail/e-mail-reader.c
@@ -1184,6 +1184,9 @@ action_mail_show_all_headers_cb (GtkToggleAction *action,
 
 	formatter = e_mail_reader_get_formatter (reader);
 
+	if (!formatter)
+		return;
+
 	if (gtk_toggle_action_get_active (action))
 		mode = EM_FORMAT_ALLHEADERS;
 	else
@@ -1213,7 +1216,10 @@ action_mail_show_source_cb (GtkAction *action,
 	browser = e_mail_browser_new (shell_backend);
 	reader = E_MAIL_READER (browser);
 	formatter = e_mail_reader_get_formatter (reader);
-	em_format_set_mode (EM_FORMAT (formatter), EM_FORMAT_SOURCE);
+
+	if (formatter)
+		em_format_set_mode (EM_FORMAT (formatter), EM_FORMAT_SOURCE);
+
 	e_mail_reader_set_folder (reader, folder, folder_uri);
 	e_mail_reader_set_message (reader, uids->pdata[0]);
 	gtk_widget_show (browser);



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