From: guyzmo Date: Tue, 14 Feb 2017 14:49:32 +0000 (+0100) Subject: Fixes missing failure return of notmuch msg open (#401) X-Git-Tag: neomutt-20170225~28 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d7c605611eb73dbccfcc7a87d43bf27232f39661;p=neomutt Fixes missing failure return of notmuch msg open (#401) When calling the mx_ops->open_msg() method of the notmuch implementation, if the message failed to open, it is not reported to the user interface. This patch returns a non-zero value that will prevent a crash. fixes #308 Signed-off-by: Pietro Cerutti Signed-off-by: Guyzmo --- diff --git a/mutt_notmuch.c b/mutt_notmuch.c index aa6bafe8d..ba252da88 100644 --- a/mutt_notmuch.c +++ b/mutt_notmuch.c @@ -2430,7 +2430,7 @@ static int nm_open_message(CONTEXT *ctx, MESSAGE *msg, int msgno) msg->fp = maildir_open_find_message(folder, cur->path, NULL); mutt_debug (1, "%s\n", __func__); - return 0; + return !msg->fp; } static int nm_close_message(CONTEXT *ctx, MESSAGE *msg)