Skip to content
Permalink
Browse files
[JENKINS-22991] Merge pull request #1167 from christ66/ZD-16606
Fix issue where restart would not properly display username if user was not loaded.
(cherry picked from commit 22e64ab)
  • Loading branch information
ndeloof authored and olivergondza committed Jun 8, 2014
1 parent 819c1f1 commit fde98adfd054eb3a73ea5f8997124b1a7d98a3b4
Showing with 2 additions and 9 deletions.
  1. +2 −9 core/src/main/java/hudson/model/Cause.java
@@ -327,8 +327,7 @@ public UserCause() {

@Exported(visibility=3)
public String getUserName() {
User u = User.get(authenticationName, false);
return u != null ? u.getDisplayName() : authenticationName;
return User.get(authenticationName).getDisplayName();
}

@Override
@@ -369,13 +368,7 @@ public String getUserId() {

@Exported(visibility = 3)
public String getUserName() {
String userName = "anonymous";
if (userId != null) {
User user = User.get(userId, false);
if (user != null)
userName = user.getDisplayName();
}
return userName;
return userId == null ? "anonymous" : User.get(userId).getDisplayName();
}

@Override

0 comments on commit fde98ad

Please sign in to comment.