summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2012-07-17 07:44:41 -0400
committerJames Moger <james.moger@gitblit.com>2012-07-17 07:44:41 -0400
commita01257b8a1ace8e8b13e6a3b25aebb0348610409 (patch)
tree34eddf8bb612cd67b81b2c71c018e745611b21de /src/com
parentadef42eefc08541f0433147441c2f2d575ac134f (diff)
downloadgitblit-a01257b8a1ace8e8b13e6a3b25aebb0348610409.tar.gz
gitblit-a01257b8a1ace8e8b13e6a3b25aebb0348610409.zip
Fixed LdapUserService if account has null email address (issue 110)
Diffstat (limited to 'src/com')
-rw-r--r--src/com/gitblit/LdapUserService.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/com/gitblit/LdapUserService.java b/src/com/gitblit/LdapUserService.java
index bba943d9..61de01d9 100644
--- a/src/com/gitblit/LdapUserService.java
+++ b/src/com/gitblit/LdapUserService.java
@@ -220,7 +220,10 @@ public class LdapUserService extends GitblitUserService {
user.displayName = displayName;
} else {
- user.displayName = userEntry.getAttribute(displayName).getValue();
+ Attribute attribute = userEntry.getAttribute(displayName);
+ if (attribute != null && attribute.hasValue()) {
+ user.displayName = attribute.getValue();
+ }
}
}
@@ -233,7 +236,10 @@ public class LdapUserService extends GitblitUserService {
user.emailAddress = email;
} else {
- user.emailAddress = userEntry.getAttribute(email).getValue();
+ Attribute attribute = userEntry.getAttribute(email);
+ if (attribute != null && attribute.hasValue()) {
+ user.emailAddress = attribute.getValue();
+ }
}
}
}