From fd7f87564b8ed87f2582b71e5bdb7c24fcce6ab7 Mon Sep 17 00:00:00 2001 From: Andrew Pamment Date: Mon, 4 Apr 2016 11:34:46 +1000 Subject: [PATCH] Fix crash --- mail_menu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mail_menu.c b/mail_menu.c index a60868d..152c74b 100644 --- a/mail_menu.c +++ b/mail_menu.c @@ -1188,7 +1188,7 @@ int mail_menu(int socket, struct user_record *user) { s_putstring(socket, "\r\n"); // list mail in message base msghs = read_message_headers(user->cur_mail_conf, user->cur_mail_area, user); - if (msghs != NULL) { + if (msghs != NULL && msghs->msg_count > 0) { jb = open_jam_base(conf.mail_conferences[user->cur_mail_conf]->mail_areas[user->cur_mail_area]->path); if (!jb) { printf("Error opening JAM base.. %s\n", conf.mail_conferences[user->cur_mail_conf]->mail_areas[user->cur_mail_area]->path);