From: James Moger Date: Sat, 22 Dec 2012 05:27:04 +0000 (-0500) Subject: Do not pass null email address to PersonIdent X-Git-Tag: v1.2.0~1 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=b461a45f420471f931029898d97464ecc5039f49;p=gitblit.git Do not pass null email address to PersonIdent --- diff --git a/src/com/gitblit/wicket/pages/ForksPage.java b/src/com/gitblit/wicket/pages/ForksPage.java index 6155f3ed..cc483878 100644 --- a/src/com/gitblit/wicket/pages/ForksPage.java +++ b/src/com/gitblit/wicket/pages/ForksPage.java @@ -58,7 +58,7 @@ public class ForksPage extends RepositoryPage { if (repository.isPersonalRepository()) { UserModel user = GitBlit.self().getUserModel(repository.projectPath.substring(1)); - PersonIdent ident = new PersonIdent(user.getDisplayName(), user.emailAddress); + PersonIdent ident = new PersonIdent(user.getDisplayName(), user.emailAddress == null ? user.getDisplayName() : user.emailAddress); item.add(new GravatarImage("anAvatar", ident, 20)); if (pageRepository.equals(repository)) { // do not link to self diff --git a/src/com/gitblit/wicket/pages/UserPage.java b/src/com/gitblit/wicket/pages/UserPage.java index d3e93c61..f4331dd1 100644 --- a/src/com/gitblit/wicket/pages/UserPage.java +++ b/src/com/gitblit/wicket/pages/UserPage.java @@ -97,7 +97,7 @@ public class UserPage extends RootPage { email.setRenderBodyOnly(true); add(email.setVisible(GitBlit.getBoolean(Keys.web.showEmailAddresses, true) && !StringUtils.isEmpty(user.emailAddress))); - PersonIdent person = new PersonIdent(user.getDisplayName(), user.emailAddress); + PersonIdent person = new PersonIdent(user.getDisplayName(), user.emailAddress == null ? user.getDisplayName() : user.emailAddress); add(new GravatarImage("gravatar", person, 210)); UserModel sessionUser = GitBlitWebSession.get().getUser(); diff --git a/src/com/gitblit/wicket/panels/RegistrantPermissionsPanel.java b/src/com/gitblit/wicket/panels/RegistrantPermissionsPanel.java index 689ee571..4156cd19 100644 --- a/src/com/gitblit/wicket/panels/RegistrantPermissionsPanel.java +++ b/src/com/gitblit/wicket/panels/RegistrantPermissionsPanel.java @@ -138,10 +138,10 @@ public class RegistrantPermissionsPanel extends BasePanel { } } else if (RegistrantType.USER.equals(entry.registrantType)) { // user - PersonIdent ident = new PersonIdent(entry.registrant, null); + PersonIdent ident = new PersonIdent(entry.registrant, ""); UserModel user = GitBlit.self().getUserModel(entry.registrant); if (user != null) { - ident = new PersonIdent(user.getDisplayName(), user.emailAddress); + ident = new PersonIdent(user.getDisplayName(), user.emailAddress == null ? user.getDisplayName() : user.emailAddress); } Fragment userFragment = new Fragment("registrant", "userRegistrant", RegistrantPermissionsPanel.this);