aboutsummaryrefslogtreecommitdiffhomepage
path: root/notmuch-show.c
diff options
context:
space:
mode:
authorGravatar Carl Worth <cworth@cworth.org>2009-11-17 17:53:54 -0800
committerGravatar Carl Worth <cworth@cworth.org>2009-11-17 17:55:45 -0800
commit58b659f893084fde2c79b8d0ce053b3bc4946b7c (patch)
treef96e4792cb20a866d7a021db02225e38c571c79f /notmuch-show.c
parent64c03ae97f2f5294c60ef25d7f41849864e6ebd3 (diff)
notmuch show: Detect an internal error if a thread has no messages.
This really should be impossible---if there are no messages, then what was the thread object created from? During recent debugging, it was useful to have this error detected and reported.
Diffstat (limited to 'notmuch-show.c')
-rw-r--r--notmuch-show.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/notmuch-show.c b/notmuch-show.c
index 7749dbc4..a3f354ed 100644
--- a/notmuch-show.c
+++ b/notmuch-show.c
@@ -211,6 +211,10 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[]))
messages = notmuch_thread_get_toplevel_messages (thread);
+ if (messages == NULL)
+ INTERNAL_ERROR ("Thread %s has no toplevel messages.\n",
+ notmuch_thread_get_thread_id (thread));
+
show_messages (ctx, messages, 0);
notmuch_thread_destroy (thread);