X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=message-file.c;fp=message-file.c;h=fd7e68b48ed8d276890adac7eb8a31fedeb5120b;hp=4f4f551be8e3051497640ab63ff75c4ec02d4f4a;hb=1ae8c41cdab2f753b61a4966730d90047459cc08;hpb=77f9d3ee0eac9f91e6d298e9e3774f4b161fa713 diff --git a/message-file.c b/message-file.c index 4f4f551b..fd7e68b4 100644 --- a/message-file.c +++ b/message-file.c @@ -298,5 +298,19 @@ notmuch_message_file_get_header (notmuch_message_file_t *message, message->value.len = 0; } + /* We've parsed all headers and never found the one we're looking + * for. It's probably just not there, but let's check that we + * didn't make a mistake preventing us from seeing it. */ + if (message->restrict_headers && + ! g_hash_table_lookup_extended (message->headers, + header_desired, NULL, NULL)) + { + fprintf (stderr, + "Internal error: Attempt to get header \"%s\" which was not\n" + "included in call to notmuch_message_file_restrict_headers\n", + header_desired); + exit (1); + } + return NULL; }