]> git.notmuchmail.org Git - notmuch/commitdiff
lib/message: use passed database for error handling
authorDavid Bremner <david@tethera.net>
Mon, 24 May 2021 00:08:29 +0000 (21:08 -0300)
committerDavid Bremner <david@tethera.net>
Sat, 5 Jun 2021 18:41:28 +0000 (15:41 -0300)
'message' should always be initialized if we reach here, but in case it
is not, we still want to be able to log an error message.

lib/message.cc

index 560f274658538d78ab72869251de0bc970557497..63b216b638127c3ccc1b92bfdfc5d89cbed5c753 100644 (file)
@@ -288,7 +288,7 @@ _notmuch_message_create_for_message_id (notmuch_database_t *notmuch,
 
        doc_id = _notmuch_database_generate_doc_id (notmuch);
     } catch (const Xapian::Error &error) {
-       _notmuch_database_log (notmuch_message_get_database (message),
+       _notmuch_database_log (notmuch,
                               "A Xapian exception occurred creating message: %s\n",
                               error.get_msg ().c_str ());
        notmuch->exception_reported = true;