aboutsummaryrefslogtreecommitdiffhomepage
path: root/notmuch-new.c
diff options
context:
space:
mode:
Diffstat (limited to 'notmuch-new.c')
-rw-r--r--notmuch-new.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/notmuch-new.c b/notmuch-new.c
index e79593cd..96a1e31e 100644
--- a/notmuch-new.c
+++ b/notmuch-new.c
@@ -743,7 +743,9 @@ remove_filename (notmuch_database_t *notmuch,
status = notmuch_database_begin_atomic (notmuch);
if (status)
return status;
- message = notmuch_database_find_message_by_filename (notmuch, path);
+ status = notmuch_database_find_message_by_filename (notmuch, path, &message);
+ if (status || message == NULL)
+ return status;
status = notmuch_database_remove_message (notmuch, path);
if (status == NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID) {
add_files_state->renamed_messages++;