Instead of checking recipients != NULL, check that camel_address_length

2003-01-04  Jeffrey Stedfast  <fejj@ximian.com>

	* providers/smtp/camel-smtp-transport.c (smtp_send_to): Instead of
	checking recipients != NULL, check that camel_address_length
	(recipients) != 0 since it is illegal for recipients to be NULL
	(camel_transport_send_to already checks this).

svn path=/trunk/; revision=19235
This commit is contained in:
Jeffrey Stedfast
2003-01-04 22:50:01 +00:00
committed by Jeffrey Stedfast
parent 6313402ba1
commit 73fa3a6e62
2 changed files with 9 additions and 2 deletions

View File

@ -1,3 +1,10 @@
2003-01-04 Jeffrey Stedfast <fejj@ximian.com>
* providers/smtp/camel-smtp-transport.c (smtp_send_to): Instead of
checking recipients != NULL, check that camel_address_length
(recipients) != 0 since it is illegal for recipients to be NULL
(camel_transport_send_to already checks this).
2002-12-17 Jeffrey Stedfast <fejj@ximian.com> 2002-12-17 Jeffrey Stedfast <fejj@ximian.com>
* providers/imap/camel-imap-utils.c: Replace calls to * providers/imap/camel-imap-utils.c: Replace calls to

View File

@ -698,14 +698,14 @@ smtp_send_to (CamelTransport *transport, CamelMimeMessage *message,
return FALSE; return FALSE;
} }
if (!recipients) { len = camel_address_length (recipients);
if (len == 0) {
camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
_("Cannot send message: no recipients defined.")); _("Cannot send message: no recipients defined."));
camel_operation_end (NULL); camel_operation_end (NULL);
return FALSE; return FALSE;
} }
len = camel_address_length (recipients);
cia = CAMEL_INTERNET_ADDRESS (recipients); cia = CAMEL_INTERNET_ADDRESS (recipients);
for (i = 0; i < len; i++) { for (i = 0; i < len; i++) {
if (!camel_internet_address_get (cia, i, NULL, &addr)) { if (!camel_internet_address_get (cia, i, NULL, &addr)) {