]> granicus.if.org Git - neomutt/commitdiff
Fixes missing failure return of notmuch msg open (#401)
authorguyzmo <guyzmo+github+pub@m0g.net>
Tue, 14 Feb 2017 14:49:32 +0000 (15:49 +0100)
committerRichard Russon <rich@flatcap.org>
Tue, 14 Feb 2017 14:49:32 +0000 (14:49 +0000)
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 <gahr@gahr.ch>
Signed-off-by: Guyzmo <guyzmo+github+pub@m0g.net>
mutt_notmuch.c

index aa6bafe8d39cb07c0ddb37322fc18f35679e256e..ba252da885e4fb92e23add19baccbaadb2c24e9e 100644 (file)
@@ -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)