]> git.notmuchmail.org Git - notmuch/blobdiff - lib/message.cc
lib: catch Xapian exceptions in n_m_get_tags
[notmuch] / lib / message.cc
index f4306e2cacb6a780b51df44b68c7508f9edcc3b8..364cdc9d4e86764ddd5502f5e0034c1424a555ac 100644 (file)
@@ -1206,7 +1206,12 @@ notmuch_message_get_tags (notmuch_message_t *message)
 {
     notmuch_tags_t *tags;
 
 {
     notmuch_tags_t *tags;
 
-    _notmuch_message_ensure_metadata (message, message->tag_list);
+    try {
+       _notmuch_message_ensure_metadata (message, message->tag_list);
+    } catch (Xapian::Error &error) {
+       LOG_XAPIAN_EXCEPTION (message, error);
+       return NULL;
+    }
 
     tags = _notmuch_tags_create (message, message->tag_list);
     /* _notmuch_tags_create steals the reference to the tag_list, but
 
     tags = _notmuch_tags_create (message, message->tag_list);
     /* _notmuch_tags_create steals the reference to the tag_list, but