X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;ds=sidebyside;f=message.cc;h=66747b5c0aedd38e40b02d128ba7040826cd061f;hb=19ec20192c6c2514eed58993d47ca11558cb6519;hp=6e15b51118be82b960fb13aae667241fdbf36048;hpb=31db02a8c1afdb025da6e0e7e62630ffffc69eb7;p=notmuch diff --git a/message.cc b/message.cc index 6e15b511..66747b5c 100644 --- a/message.cc +++ b/message.cc @@ -465,7 +465,14 @@ _notmuch_message_remove_term (notmuch_message_t *message, if (strlen (term) > NOTMUCH_TERM_MAX) return NOTMUCH_PRIVATE_STATUS_TERM_TOO_LONG; - message->doc.remove_term (term); + try { + message->doc.remove_term (term); + } catch (const Xapian::InvalidArgumentError) { + /* We'll let the philosopher's try to wrestle with the + * question of whether failing to remove that which was not + * there in the first place is failure. For us, we'll silently + * consider it all good. */ + } talloc_free (term);