diff options
author | James Moger <james.moger@gitblit.com> | 2012-10-22 16:16:57 -0400 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2012-10-22 16:16:57 -0400 |
commit | ba54242b0d080475bbfce2ab559b3fcf2a513a5b (patch) | |
tree | 3f2902dbbe1ab2128ff1afad4be56c9e9417e494 | |
parent | 87f6c3e6510986a6676872aa64aed66fe7f24b01 (diff) | |
download | gitblit-ba54242b0d080475bbfce2ab559b3fcf2a513a5b.tar.gz gitblit-ba54242b0d080475bbfce2ab559b3fcf2a513a5b.zip |
Fixed null pointer exceptions Manager create User and Team
-rw-r--r-- | src/com/gitblit/client/EditTeamDialog.java | 9 | ||||
-rw-r--r-- | src/com/gitblit/client/EditUserDialog.java | 9 |
2 files changed, 14 insertions, 4 deletions
diff --git a/src/com/gitblit/client/EditTeamDialog.java b/src/com/gitblit/client/EditTeamDialog.java index 4eb07295..81146fc6 100644 --- a/src/com/gitblit/client/EditTeamDialog.java +++ b/src/com/gitblit/client/EditTeamDialog.java @@ -49,6 +49,7 @@ import com.gitblit.models.RegistrantAccessPermission; import com.gitblit.models.RepositoryModel;
import com.gitblit.models.ServerSettings;
import com.gitblit.models.TeamModel;
+import com.gitblit.utils.ArrayUtils;
import com.gitblit.utils.StringUtils;
public class EditTeamDialog extends JDialog {
@@ -316,8 +317,12 @@ public class EditTeamDialog extends JDialog { }
// remove repositories for which team already has a permission
- for (RegistrantAccessPermission rp : permissions) {
- restricted.remove(rp.registrant);
+ if (permissions == null) {
+ permissions = new ArrayList<RegistrantAccessPermission>();
+ } else {
+ for (RegistrantAccessPermission rp : permissions) {
+ restricted.remove(rp.registrant);
+ }
}
StringUtils.sortRepositorynames(restricted);
diff --git a/src/com/gitblit/client/EditUserDialog.java b/src/com/gitblit/client/EditUserDialog.java index 5b789da5..da75867f 100644 --- a/src/com/gitblit/client/EditUserDialog.java +++ b/src/com/gitblit/client/EditUserDialog.java @@ -347,9 +347,14 @@ public class EditUserDialog extends JDialog { restricted.add(repo.name);
}
}
+
// remove repositories for which user already has a permission
- for (RegistrantAccessPermission rp : permissions) {
- restricted.remove(rp.registrant);
+ if (permissions == null) {
+ permissions = new ArrayList<RegistrantAccessPermission>();
+ } else {
+ for (RegistrantAccessPermission rp : permissions) {
+ restricted.remove(rp.registrant);
+ }
}
StringUtils.sortRepositorynames(restricted);
|