mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-22 10:58:10 +01:00
Protect against missing message id while indexing files
This commit is contained in:
parent
8f3ccda00f
commit
a2c467242a
2 changed files with 6 additions and 4 deletions
2
Makefile
2
Makefile
|
@ -1,6 +1,6 @@
|
||||||
PROGS=notmuch-index-message xapian-dump
|
PROGS=notmuch-index-message xapian-dump
|
||||||
|
|
||||||
MYCXXFLAGS=-Wall
|
MYCXXFLAGS=-Wall -O0 -g
|
||||||
|
|
||||||
all: $(PROGS)
|
all: $(PROGS)
|
||||||
|
|
||||||
|
|
|
@ -662,8 +662,10 @@ index_file (Xapian::WritableDatabase db,
|
||||||
add_term (doc, "type", "mail");
|
add_term (doc, "type", "mail");
|
||||||
add_term (doc, "source_id", "1");
|
add_term (doc, "source_id", "1");
|
||||||
|
|
||||||
|
if (message_id) {
|
||||||
add_term (doc, "msgid", message_id);
|
add_term (doc, "msgid", message_id);
|
||||||
doc.add_value (NOTMUCH_VALUE_MESSAGE_ID, message_id);
|
doc.add_value (NOTMUCH_VALUE_MESSAGE_ID, message_id);
|
||||||
|
}
|
||||||
|
|
||||||
if (thread_ids->len) {
|
if (thread_ids->len) {
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
@ -687,7 +689,7 @@ index_file (Xapian::WritableDatabase db,
|
||||||
doc.add_value (NOTMUCH_VALUE_THREAD, thread_id->str);
|
doc.add_value (NOTMUCH_VALUE_THREAD, thread_id->str);
|
||||||
|
|
||||||
g_string_free (thread_id, TRUE);
|
g_string_free (thread_id, TRUE);
|
||||||
} else {
|
} else if (message_id) {
|
||||||
/* If not referenced thread, use the message ID */
|
/* If not referenced thread, use the message ID */
|
||||||
add_term (doc, "thread", message_id);
|
add_term (doc, "thread", message_id);
|
||||||
doc.add_value (NOTMUCH_VALUE_THREAD, message_id);
|
doc.add_value (NOTMUCH_VALUE_THREAD, message_id);
|
||||||
|
|
Loading…
Reference in a new issue