Skip to content

Commit

Permalink
LDAP: Prevent error when user attr field is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
doortts committed Jul 4, 2017
1 parent e115c18 commit e3f9e87
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/controllers/UserApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -1153,7 +1153,7 @@ public static User authenticateWithLdap(String loginIdOrEmail, String password)
User.resetPassword(localUserFoundByLdapLogin.loginId, password);
}

if (StringUtils.isNotEmpty(ldapUser.getDepartment())) {
if (StringUtils.isNotBlank(ldapUser.getDepartment())) {
localUserFoundByLdapLogin.name = ldapUser.getDisplayName() + " [" + ldapUser.getDepartment() + "]";
} else {
localUserFoundByLdapLogin.name = ldapUser.getDisplayName();
Expand Down
2 changes: 1 addition & 1 deletion app/models/support/LdapUser.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public String getDisplayName() {

private String getString(Attribute attr) {
try {
if (attr.get() == null){
if (attr == null || attr.get() == null){
return "";
} else {
return attr.get().toString();
Expand Down

0 comments on commit e3f9e87

Please sign in to comment.