Skip to content

Commit

Permalink
[FIXED JENKINS-21875]
Browse files Browse the repository at this point in the history
User.current() can return null, so this better check for null
  • Loading branch information
kohsuke committed Mar 26, 2014
1 parent 20ea8d1 commit d487d1f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions changelog.html
Expand Up @@ -61,6 +61,9 @@
<li class=bug>
Fixed a slow down in resource loading caused by fix to JENKINS-18677.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-21579">issue 21579</a>)
<li class=bug>
Fixed NPE in <tt>UserCause</tt>
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-21875">issue 21875</a>)
</ul>
</div><!--=TRUNK-END=-->

Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/hudson/slaves/OfflineCause.java
Expand Up @@ -109,7 +109,7 @@ public static class UserCause extends SimpleOfflineCause {

public UserCause(User user, String message) {
super(hudson.slaves.Messages._SlaveComputer_DisconnectedBy(
user.getId(),
user!=null ? user.getId() : Jenkins.ANONYMOUS.getName(),
message != null ? " : " + message : ""
));
this.user = user;
Expand Down

0 comments on commit d487d1f

Please sign in to comment.