mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-12-22 09:24:54 +01:00
Prevent that last bug from reoccurring.
It's even enough to check if a "missing" header was accidentally left off the list in the call to restrict_headers. (And it's cheap since we only check in case no such header was found in the message.)
This commit is contained in:
parent
77f9d3ee0e
commit
1ae8c41cda
1 changed files with 14 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue