X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=notmuch-new.c;h=96a1e31e732da0b4d16cbdc374848d810904eb96;hp=e79593cd092dd3345a8bac182234833ecfc92333;hb=02a30767;hpb=9b3f16ce715d2371224955bc5b6f948eaa4ee325 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++;