]> git.notmuchmail.org Git - notmuch/blobdiff - lib/message.cc
lib: Don't needlessly create directory docs in _notmuch_message_remove_filename
[notmuch] / lib / message.cc
index 8d552f1fc07d91d03f3fcbf94b49de17fc644581..67875065f5c93f01edbad2387172d3767be59364 100644 (file)
@@ -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. */