提交 6fdad8b6 编写于 作者: K kohsuke

fixed a NPE.


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@1283 71c3de6d-444a-0410-be80-ed276b4c234a
上级 1d408ae3
...@@ -242,7 +242,7 @@ public class Mailer extends Publisher { ...@@ -242,7 +242,7 @@ public class Mailer extends Publisher {
return msg; return msg;
} }
private MimeMessage createEmptyMail(Build build) throws MessagingException { private MimeMessage createEmptyMail(Build build, BuildListener listener) throws MessagingException {
MimeMessage msg = new MimeMessage(DESCRIPTOR.createSession()); MimeMessage msg = new MimeMessage(DESCRIPTOR.createSession());
// TODO: I'd like to put the URL to the page in here, // TODO: I'd like to put the URL to the page in here,
// but how do I obtain that? // but how do I obtain that?
...@@ -262,6 +262,9 @@ public class Mailer extends Publisher { ...@@ -262,6 +262,9 @@ public class Mailer extends Publisher {
String adrs = a.getProperty(UserProperty.class).getAddress(); String adrs = a.getProperty(UserProperty.class).getAddress();
if(adrs!=null) if(adrs!=null)
rcp.add(new InternetAddress(adrs)); rcp.add(new InternetAddress(adrs));
else {
listener.getLogger().println("Failed to send e-mail to "+a.getFullName()+" because no e-mail address is known, and no default e-mail domain is configured");
}
} }
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册