X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=notmuch-show.c;h=4ed5fc74a1796f98ef41da996c7f4ee5e55df6a4;hp=26449fa5bd0c2efde1d6f45460ee36cef60ce342;hb=9c7668bdb51e4739eecda83b6452ef668ed0efa3;hpb=42e146a3a20c1ca2e1a9d6fd2d5e5e9d03a06641 diff --git a/notmuch-show.c b/notmuch-show.c index 26449fa5..4ed5fc74 100644 --- a/notmuch-show.c +++ b/notmuch-show.c @@ -225,9 +225,15 @@ show_part_content (GMimeObject *part, GMimeStream *stream_out) g_mime_stream_filter_add(GMIME_STREAM_FILTER(stream_filter), g_mime_filter_crlf_new(FALSE, FALSE)); if (charset) { - g_mime_stream_filter_add(GMIME_STREAM_FILTER(stream_filter), - g_mime_filter_charset_new(charset, "UTF-8")); - } + GMimeFilter *charset_filter; + charset_filter = g_mime_filter_charset_new(charset, "UTF-8"); + /* This result can be NULL for things like "unknown-8bit". + * Don't set a NULL filter as that makes GMime print + * annoying assertion-failure messages on stderr. */ + if (charset_filter) + g_mime_stream_filter_add(GMIME_STREAM_FILTER(stream_filter), + charset_filter); + } } wrapper = g_mime_part_get_content_object (GMIME_PART (part));