|
From: Christophe V. <c.v...@pa...> - 2003-09-15 00:38:18
|
Hi,
I discovered a problem with the JavaMailSender class.
When you don't have any CC adresses set, you'll get a NPE while composing the JavaMail message (the MailCC array is never initialized, and it shouldn't have to be set explicitly to an empty array if there are no CC's).
This is the fix:
--- JavaMailSender.java 10 Sep 2003 00:14:54 -0000 1.1
+++ JavaMailSender.java 15 Sep 2003 00:32:34 -0000
@@ -47,7 +47,7 @@ public class JavaMailSender implements M
message.setText(mailSettings.getMailText());
message.setFrom(new InternetAddress(mailSettings.getMailFrom()));
message.addRecipient(Message.RecipientType.TO, new InternetAddress(mailSettings.getMailTo()));
- if (mailSettings.getMailCc().length > 0) {
+ if (mailSettings.getMailCc() != null) {
for (int i = 0; i < mailSettings.getMailCc().length; i++)
message.addRecipient(Message.RecipientType.CC, new InternetAddress(mailSettings.getMailCc()[i]));
}
--
Kind regards,
Christophe Vanfleteren
|