From 756117adc7f5b4bd21948ede7ab0085aa42d5ccc Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Tue, 07 Aug 2012 09:43:24 -0400
Subject: [PATCH] Fix to GitServlet to allow pushing to symlinked repositories (issue 116)

---
 src/com/gitblit/LdapUserService.java |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/com/gitblit/LdapUserService.java b/src/com/gitblit/LdapUserService.java
index bba943d..61de01d 100644
--- a/src/com/gitblit/LdapUserService.java
+++ b/src/com/gitblit/LdapUserService.java
@@ -220,7 +220,10 @@
 
 				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 @@
 
 				user.emailAddress = email;
 			} else {
-				user.emailAddress = userEntry.getAttribute(email).getValue();
+				Attribute attribute = userEntry.getAttribute(email);
+				if (attribute != null && attribute.hasValue()) {
+					user.emailAddress = attribute.getValue();
+				}
 			}
 		}
 	}

--
Gitblit v1.9.1