[evolution/webkit] Prevent possible crash when there's no formatter set in EMailDisplay



commit 5f592573ed142c448bd0de9b0cc1fa5215112fa5
Author: Dan VrÃtil <dvratil redhat com>
Date:   Thu Mar 1 17:35:08 2012 +0100

    Prevent possible crash when there's no formatter set in EMailDisplay

 mail/e-mail-display.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/mail/e-mail-display.c b/mail/e-mail-display.c
index 1b0cfbc..cd1d02c 100644
--- a/mail/e-mail-display.c
+++ b/mail/e-mail-display.c
@@ -444,6 +444,11 @@ mail_display_resource_requested (WebKitWebView *web_view,
 	EMFormat *formatter = EM_FORMAT (display->priv->formatter);
 	const gchar *uri = webkit_network_request_get_uri (request);
 
+        if (!formatter) {
+                webkit_network_request_set_uri (request, "invalid://uri");
+                return;
+        }
+
         /* Redirect cid:part_id to mail://mail_id/cid:part_id */
         if (g_str_has_prefix (uri, "cid:")) {
 



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