aboutsummaryrefslogtreecommitdiffhomepage
path: root/message.cc
diff options
context:
space:
mode:
authorGravatar Carl Worth <cworth@cworth.org>2009-10-27 23:59:06 -0700
committerGravatar Carl Worth <cworth@cworth.org>2009-10-27 23:59:06 -0700
commit88bf876bae79cbaee50c62664bc1baac5cb79742 (patch)
tree30fde58e285320ecc815d0f8112ea4c0e061f124 /message.cc
parent07aa759b68f3198e565385eb23736984bb378d0f (diff)
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. :-)
Diffstat (limited to 'message.cc')
-rw-r--r--message.cc9
1 files changed, 8 insertions, 1 deletions
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);