Protect from stupid null usage by javax.mail.

If you add no addresses to a message, getting the recipient array
returns null rather than an empty array. So fucking dumb.
This commit is contained in:
Ray J. Greenwell
2014-01-14 11:30:08 -08:00
parent 82a55291bc
commit 241fd0824d
@@ -136,7 +136,7 @@ public class MailUtil
}
message.saveChanges();
Address[] recips = message.getAllRecipients();
if (recips.length == 0) {
if (recips == null || recips.length == 0) {
log.info("Not sending mail to zero recipients",
"subject", subject, "message", message);
return;