Fix ConversationViewer crit assertion displaying messages with no body.

Bug 767438

* src/client/conversation-viewer/conversation-viewer.vala
  (::set_message_html): Body text may be null if there's no HTML or plain
  body parts, so allow for it and check before passing to
  ::insert_html_markup.
This commit is contained in:
Michael James Gratton 2016-07-06 17:31:44 +10:00
parent e9a0b2aa77
commit cc8b79ba35

View file

@ -890,8 +890,8 @@ public class ConversationViewer : Gtk.Box {
// that are actually attachments (in particular, get_body() considers their
// Content-Disposition)
//
string body_text = "";
string? body_text = null;
remote_images = false;
try {
if (message.has_html_body()) {
@ -899,7 +899,7 @@ public class ConversationViewer : Gtk.Box {
} else {
body_text = message.get_plain_body(true, inline_image_replacer);
}
body_text = insert_html_markup(body_text, message, out remote_images);
body_text = insert_html_markup(body_text ?? "", message, out remote_images);
} catch (Error err) {
debug("Could not get message text. %s", err.message);
}