Skip to content

Commit 89e54f3

Browse files
committed
Fixed possible NPE in forks page if user account no longer exists
1 parent 64dbf8c commit 89e54f3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/main/java/com/gitblit/wicket/pages/ForksPage.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ public void populateItem(final Item<FlatFork> item) {
5858

5959
if (repository.isPersonalRepository()) {
6060
UserModel user = GitBlit.self().getUserModel(repository.projectPath.substring(1));
61+
if (user == null) {
62+
// user account no longer exists
63+
user = new UserModel(repository.projectPath.substring(1));
64+
}
6165
PersonIdent ident = new PersonIdent(user.getDisplayName(), user.emailAddress == null ? user.getDisplayName() : user.emailAddress);
6266
item.add(new GravatarImage("anAvatar", ident, 20));
6367
if (pageRepository.equals(repository)) {

0 commit comments

Comments
 (0)