X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=notmuch-restore.c;h=e4a5355beb4f2e5fd9e1eb12ef7dd9816d292951;hp=f095f64a76b7054dbda62b1fd8f9f4efa975117b;hb=02a30767116ad8abcbd0a3351f2e4d43bbbd655f;hpb=9b3f16ce715d2371224955bc5b6f948eaa4ee325 diff --git a/notmuch-restore.c b/notmuch-restore.c index f095f64a..e4a5355b 100644 --- a/notmuch-restore.c +++ b/notmuch-restore.c @@ -87,10 +87,13 @@ notmuch_restore_command (unused (void *ctx), int argc, char *argv[]) file_tags = xstrndup (line + match[2].rm_so, match[2].rm_eo - match[2].rm_so); - message = notmuch_database_find_message (notmuch, message_id); - if (message == NULL) { - fprintf (stderr, "Warning: Cannot apply tags to missing message: %s\n", - message_id); + status = notmuch_database_find_message (notmuch, message_id, &message); + if (status || message == NULL) { + fprintf (stderr, "Warning: Cannot apply tags to %smessage: %s\n", + message ? "" : "missing ", message_id); + if (status) + fprintf (stderr, "%s\n", + notmuch_status_to_string(status)); goto NEXT_LINE; }