提交 16ee6c7f 编写于 作者: K kohsuke

added defensive code to fix the NPE as reported below:

I sporadically get a NPE when trying to send an email at the end of a build:
Recording test results
FATAL: null
java.lang.NullPointerException
	at hudson.tasks.MailSender.createFailureMail(MailSender.java:157)
	at hudson.tasks.MailSender.getMail(MailSender.java:87)
	at hudson.tasks.MailSender.execute(MailSender.java:64)
	at hudson.tasks.Mailer.perform(Mailer.java:61)
	at hudson.model.Build$RunnerImpl.post(Build.java:137)
	at hudson.model.Run.run(Run.java:573)
	at hudson.model.Build.run(Build.java:101)
	at hudson.model.Executor.run(Executor.java:61)
I haven't narrowed down if this happens only for failed builds or for any
build.  Once it happens the only way it goes away is if I clear the email
option, save, and reset it.
Any ideas what's going on?
Rich
ePlus Consulting
-- View this message in context: http://www.nabble.com/NPE-trying-to-send-email-tf3772528.html#a10666153 Sent from the Hudson users mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@hudson.dev.java.net For additional commands, e-mail: users-help@hudson.dev.java.net


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@3345 71c3de6d-444a-0410-be80-ed276b4c234a
上级 4c8a2e54
......@@ -139,6 +139,9 @@ public class User extends AbstractModelObject {
}
public static User getUnknown() {
return get("unknown");
}
public static User get(String name) {
if(name==null)
......
......@@ -147,6 +147,8 @@ public final class CVSChangeLogSet extends ChangeLogSet<CVSChangeLog> {
@Exported
public User getAuthor() {
if(author==null)
return User.getUnknown();
return author;
}
......
......@@ -92,6 +92,8 @@ public final class SubversionChangeLogSet extends ChangeLogSet<LogEntry> {
@Override
public User getAuthor() {
if(author==null)
return User.getUnknown();
return author;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册