unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] Do not attept to output part raw if part is not GMimePart.
@ 2011-06-02 16:38 Jameson Graef Rollins
  2011-06-03 17:01 ` Jameson Graef Rollins
  0 siblings, 1 reply; 15+ messages in thread
From: Jameson Graef Rollins @ 2011-06-02 16:38 UTC (permalink / raw)
  To: Notmuch Mail

This was a minor oversite in checking of part type when outputing
content raw.  This was causing gmime was to throw an exception to
stderr.

Unfortunately the gmime exception was not being caught by notmuch, or
the test suite.  I'm not sure if notmuch should have done anything in
this case, but certainly the test suite should be capable of detecting
that something unexpected was output to stderr.
---
 notmuch-show.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/notmuch-show.c b/notmuch-show.c
index 9267d02..3b4f775 100644
--- a/notmuch-show.c
+++ b/notmuch-show.c
@@ -646,14 +646,15 @@ format_part_content_raw (GMimeObject *part)
 {
     GMimeStream *stream_stdout;
     GMimeStream *stream_filter = NULL;
-    GMimeDataWrapper *wrapper;
+    GMimeDataWrapper *wrapper = NULL;
 
     stream_stdout = g_mime_stream_file_new (stdout);
     g_mime_stream_file_set_owner (GMIME_STREAM_FILE (stream_stdout), FALSE);
 
     stream_filter = g_mime_stream_filter_new (stream_stdout);
 
-    wrapper = g_mime_part_get_content_object (GMIME_PART (part));
+    if (GMIME_IS_PART (part))
+	wrapper = g_mime_part_get_content_object (GMIME_PART (part));
 
     if (wrapper && stream_filter)
 	g_mime_data_wrapper_write_to_stream (wrapper, stream_filter);
-- 
1.7.4.4

^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2011-09-07 23:28 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-02 16:38 [PATCH] Do not attept to output part raw if part is not GMimePart Jameson Graef Rollins
2011-06-03 17:01 ` Jameson Graef Rollins
2011-06-23 23:33   ` Carl Worth
2011-06-27 17:07     ` Jameson Graef Rollins
2011-06-27 20:43       ` Austin Clements
2011-06-27 21:04         ` Daniel Kahn Gillmor
2011-06-27 21:44         ` Jameson Graef Rollins
2011-06-27 22:07           ` Austin Clements
2011-06-27 22:41             ` interaction between --format=raw and multipart handling [was: Re: Do not attept to output part raw if part is not GMimePart.] Daniel Kahn Gillmor
2011-06-28  2:12               ` Austin Clements
2011-09-06 16:43   ` [PATCH] Do not attept to output part raw if part is not GMimePart Jameson Graef Rollins
2011-09-06 16:49     ` Dmitry Kurochkin
2011-09-06 22:51     ` Jameson Graef Rollins
2011-09-07 21:46       ` David Bremner
2011-09-07 22:10         ` Jameson Graef Rollins

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).