]> git.notmuchmail.org Git - notmuch/blobdiff - message.cc
notmuch restore: Print names of tags that cannot be applied
[notmuch] / message.cc
index ce600af94b1340310aa252cf7a8ee0433aae1929..ee0e8e1f80502f81aa74c7cfc3994866e852ef41 100644 (file)
@@ -215,10 +215,11 @@ notmuch_message_get_message_id (notmuch_message_t *message)
     i = message->doc.termlist_begin ();
     i.skip_to (_find_prefix ("msgid"));
 
-    /* XXX: This should really be an internal error, but we'll need to
-     * fix the add_message side of things first. */
-    if (i == message->doc.termlist_end ())
-       return NULL;
+    if (i == message->doc.termlist_end ()) {
+       fprintf (stderr, "Internal error: Message with document ID of %d has no message ID.\n",
+                message->doc_id);
+       exit (1);
+    }
 
     message->message_id = talloc_strdup (message, (*i).c_str () + 1);
     return message->message_id;
@@ -521,7 +522,7 @@ notmuch_tags_has_more (notmuch_tags_t *tags)
        return FALSE;
 
     s = *tags->iterator;
-    if (s.size () && s[0] == 'L')
+    if (! s.empty () && s[0] == 'L')
        return TRUE;
     else
        return FALSE;