mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-12-22 17:34:54 +01:00
lib: Make notmuch_database_find_message_by_filename not crash on read-only databases
Previously, _notmuch_database_filename_to_direntry would abort with an internal error when called on a read-only database. Now that creating the directory document is optional, notmuch_database_find_message_by_filename can disable directory document creation (as it should) and, as a result, not abort on read-only databases.
This commit is contained in:
parent
f1f1e39639
commit
cdd698f969
1 changed files with 2 additions and 2 deletions
|
@ -1895,8 +1895,8 @@ notmuch_database_find_message_by_filename (notmuch_database_t *notmuch,
|
|||
|
||||
try {
|
||||
status = _notmuch_database_filename_to_direntry (
|
||||
local, notmuch, filename, NOTMUCH_FIND_CREATE, &direntry);
|
||||
if (status)
|
||||
local, notmuch, filename, NOTMUCH_FIND_LOOKUP, &direntry);
|
||||
if (status || !direntry)
|
||||
goto DONE;
|
||||
|
||||
term = talloc_asprintf (local, "%s%s", prefix, direntry);
|
||||
|
|
Loading…
Reference in a new issue