diff options
Diffstat (limited to 'mail/e-mail-display.c')
-rw-r--r-- | mail/e-mail-display.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/mail/e-mail-display.c b/mail/e-mail-display.c index 1ffeb82c1b..96c7d97c78 100644 --- a/mail/e-mail-display.c +++ b/mail/e-mail-display.c @@ -1401,9 +1401,11 @@ e_mail_display_set_formatter (EMailDisplay *display, EMFormatHTML *formatter) { g_return_if_fail (E_IS_MAIL_DISPLAY (display)); - g_return_if_fail (EM_IS_FORMAT_HTML (formatter)); - g_object_ref (formatter); + if (formatter) { + g_return_if_fail (EM_IS_FORMAT_HTML (formatter)); + g_object_ref (formatter); + } if (display->priv->formatter != NULL) { /* The formatter might still exist after unrefing it, so @@ -1415,6 +1417,11 @@ e_mail_display_set_formatter (EMailDisplay *display, display->priv->formatter = formatter; + if (!formatter) { + e_web_view_clear (E_WEB_VIEW (display)); + return; + } + mail_display_update_formatter_colors (display); g_signal_connect (formatter, "notify::image-loading-policy", |