-
Notifications
You must be signed in to change notification settings - Fork 110
Description
Even though the method's java doc states:
Set the RFC 822 "From" header field. Any existing values are replaced with the given address.
If address isnull, this header is removed.
The change in ac77368 is deferring the null check to remove the header to setAddressHeader(); however it is providing an array with a single null element, which is not what the code expects.
setFrom(InternetAddress) fails with the following stacktrace:
java.lang.NullPointerException
at javax.mail.internet.InternetAddress.toUnicodeString(InternetAddress.java:534)
at javax.mail.internet.MimeMessage.setAddressHeader(MimeMessage.java:731)
at javax.mail.internet.MimeMessage.setFrom(MimeMessage.java:382)
setFrom(String) fails with the following stacktrace:
java.lang.NullPointerException
at javax.mail.internet.InternetAddress.parse(InternetAddress.java:769)
at javax.mail.internet.InternetAddress.parse(InternetAddress.java:728)
at javax.mail.internet.InternetAddress.parse(InternetAddress.java:705)
at javax.mail.internet.MimeMessage.setFrom(MimeMessage.java:400)
Either the if/else check on each setXxx() method should be reinstated, or setAddressHeader() should expect an array with a single null value.
Metadata
Metadata
Assignees
Labels
No labels