NPE when sending plain text email

Bug #468233 reported by tomas
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
play framework
Status tracked in 1.0
1.0
Fix Released
Undecided
Nicolas Leroux
1.1
Fix Committed
Undecided
Unassigned

Bug Description

If I create just plain text view (.txt) for email, I get an NPE:
play.exceptions.JavaExecutionException
        at play.mvc.ActionInvoker.invoke(ActionInvoker.java:200)
        at Invocation.HTTP Request(Play!)
Caused by: java.lang.NullPointerException
        at javax.mail.internet.MimeUtility.checkAscii(MimeUtility.java:1346)
        at javax.mail.internet.MimeBodyPart.setText(MimeBodyPart.java:1069)
        at javax.mail.internet.MimeMessage.setText(MimeMessage.java:1493)
        at javax.mail.internet.MimeMessage.setText(MimeMessage.java:1477)
        at play.libs.Mail.buildMessage(Mail.java:215)
        at play.libs.Mail.send(Mail.java:162)
        at play.mvc.Mailer.send(Mailer.java:190)

It occurs because of this line in Mail.java:
        if ("text/plain".equals(contentType)) {
            msg.setText(body);
Variable 'body' is in this case null and the actual mail is in 'alternate' variable
I am using Play 1.0

Changed in play:
assignee: nobody → Nicolas (nicolas-lunatech)
Revision history for this message
Nicolas Leroux (nicolas-lunatech) wrote :

Fix committed in 654.

Changed in play:
status: New → In Progress
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.