changeset 1071:d71e0aa00d75 HEAD

Don't crash if we couldn't open message.
author Timo Sirainen <tss@iki.fi>
date Sat, 01 Feb 2003 13:44:40 +0200
parents 5c34c363a062
children a3e831cba5c4
files src/pop3/commands.c
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/pop3/commands.c	Sat Feb 01 13:37:22 2003 +0200
+++ b/src/pop3/commands.c	Sat Feb 01 13:44:40 2003 +0200
@@ -284,11 +284,10 @@
 	}
 
 	mail = client->mailbox->fetch_next(ctx);
-	if (mail == NULL)
+	stream = mail == NULL ? NULL : mail->get_stream(mail, NULL, NULL);
+	if (stream == NULL)
 		client_send_line(client, "-ERR Message not found.");
 	else {
-		stream = mail->get_stream(mail, NULL, NULL);
-
 		if (body_lines == (uoff_t)-1) {
 			client_send_line(client, "+OK %"PRIuUOFF_T" octets",
 					 client->message_sizes[msgnum]);