From 67389b9e7060b7f917a8383ec04d3a0c6bd24c5c Mon Sep 17 00:00:00 2001 From: James Moger Date: Tue, 26 Nov 2013 08:47:57 -0500 Subject: [PATCH] Fix NPE when adding a permission without a registrant (issue-344) Change-Id: Id6bf070a43072a61a0034bd2d971fc819c9b03e3 --- .classpath | 5 +++++ releases.moxie | 2 ++ .../gitblit/wicket/panels/RegistrantPermissionsPanel.java | 3 +++ 3 files changed, 10 insertions(+) diff --git a/.classpath b/.classpath index 2803f8d6..91e6a8bc 100644 --- a/.classpath +++ b/.classpath @@ -74,5 +74,10 @@ + + + + + diff --git a/releases.moxie b/releases.moxie index 5433a9da..ca298251 100644 --- a/releases.moxie +++ b/releases.moxie @@ -12,6 +12,7 @@ r20: { fixes: - Fixed support for implied SSH urls in web.otherUrls (issue-311) - Bind LDAP connection after establishing TLS initialization (issue-343) + - Fixed NPE when attempting to add a permission without a registrant (issue-344) - Fix potential NPE on removing uncached repository from cache - Ignore the default contents of .git/description file - Fix error on generating activity page when there is no activity @@ -72,6 +73,7 @@ r20: { - Domingo Oropeza - Chris Graham - Guenter Dressel + - fpeters.fae } # diff --git a/src/main/java/com/gitblit/wicket/panels/RegistrantPermissionsPanel.java b/src/main/java/com/gitblit/wicket/panels/RegistrantPermissionsPanel.java index b728082b..dd25c48a 100644 --- a/src/main/java/com/gitblit/wicket/panels/RegistrantPermissionsPanel.java +++ b/src/main/java/com/gitblit/wicket/panels/RegistrantPermissionsPanel.java @@ -261,6 +261,9 @@ public class RegistrantPermissionsPanel extends BasePanel { if (rp.permission == null) { return; } + if (rp.registrant == null) { + return; + } RegistrantAccessPermission copy = DeepCopier.copy(rp); if (StringUtils.findInvalidCharacter(copy.registrant) != null) { copy.permissionType = PermissionType.REGEX; -- 2.39.5