X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=lib%2Fmessage.cc;h=67875065f5c93f01edbad2387172d3767be59364;hp=8d552f1fc07d91d03f3fcbf94b49de17fc644581;hb=d9f61c26a1344b123c1812392bc39c32634a099a;hpb=54508eb78d1c5c1c67c8b220cf2bd826af1203a9 diff --git a/lib/message.cc b/lib/message.cc index 8d552f1f..67875065 100644 --- a/lib/message.cc +++ b/lib/message.cc @@ -541,8 +541,8 @@ _notmuch_message_remove_filename (notmuch_message_t *message, Xapian::TermIterator i, last; status = _notmuch_database_filename_to_direntry ( - local, message->notmuch, filename, NOTMUCH_FIND_CREATE, &direntry); - if (status) + local, message->notmuch, filename, NOTMUCH_FIND_LOOKUP, &direntry); + if (status || !direntry) return status; /* Unlink this file from its parent directory. */