]> git.notmuchmail.org Git - notmuch/blobdiff - notmuch-show.c
notmuch show: Detect an internal error if a thread has no messages.
[notmuch] / notmuch-show.c
index 7749dbc4b68ffde96b39fe81c95a993a8e708955..a3f354edb6816c0b1b41038759a795b8da626db0 100644 (file)
@@ -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);