From: James Moger Date: Mon, 22 Oct 2012 20:16:57 +0000 (-0400) Subject: Fixed null pointer exceptions Manager create User and Team X-Git-Tag: v1.2.0~141 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ba54242b0d080475bbfce2ab559b3fcf2a513a5b;p=gitblit.git Fixed null pointer exceptions Manager create User and Team --- 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(); + } 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(); + } else { + for (RegistrantAccessPermission rp : permissions) { + restricted.remove(rp.registrant); + } } StringUtils.sortRepositorynames(restricted);