X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;ds=sidebyside;f=message.cc;h=28f19a88502dc79ff29210297abfbed4f5ef2562;hb=8ae1c3c6e11f7c8d4066ef3d8affe4d07528807b;hp=a7a0cb52eeec99f34d867d264bb5d42619ddfe31;hpb=dac7e1d4b15af5a7fa6cce3112bc08eb8e8f02e6;p=notmuch diff --git a/message.cc b/message.cc index a7a0cb52..28f19a88 100644 --- a/message.cc +++ b/message.cc @@ -409,7 +409,12 @@ _notmuch_message_set_date (notmuch_message_t *message, { time_t time_value; - time_value = g_mime_utils_header_decode_date (date, NULL); + /* GMime really doesn't want to see a NULL date, so protect its + * sensibilities. */ + if (date == NULL) + time_value = 0; + else + time_value = g_mime_utils_header_decode_date (date, NULL); message->doc.add_value (NOTMUCH_VALUE_TIMESTAMP, Xapian::sortable_serialise (time_value));