mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-25 12:28:09 +01:00
notmuch tag: Fix crash when removing a tag that didn't exist
Xapian is trying to be useful by reporting that the specified term didn't exist, but this is one case where we just don't care. :-)
This commit is contained in:
parent
07aa759b68
commit
88bf876bae
1 changed files with 8 additions and 1 deletions
|
@ -465,7 +465,14 @@ _notmuch_message_remove_term (notmuch_message_t *message,
|
||||||
if (strlen (term) > NOTMUCH_TERM_MAX)
|
if (strlen (term) > NOTMUCH_TERM_MAX)
|
||||||
return NOTMUCH_PRIVATE_STATUS_TERM_TOO_LONG;
|
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);
|
talloc_free (term);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue