aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/message.cc4
1 files changed, 2 insertions, 2 deletions
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. */