import com.gitblit.models.RepositoryModel;\r
import com.gitblit.models.ServerSettings;\r
import com.gitblit.models.TeamModel;\r
+import com.gitblit.utils.ArrayUtils;\r
import com.gitblit.utils.StringUtils;\r
\r
public class EditTeamDialog extends JDialog {\r
}\r
\r
// remove repositories for which team already has a permission\r
- for (RegistrantAccessPermission rp : permissions) {\r
- restricted.remove(rp.registrant);\r
+ if (permissions == null) {\r
+ permissions = new ArrayList<RegistrantAccessPermission>();\r
+ } else {\r
+ for (RegistrantAccessPermission rp : permissions) {\r
+ restricted.remove(rp.registrant);\r
+ }\r
}\r
\r
StringUtils.sortRepositorynames(restricted);\r
restricted.add(repo.name);\r
}\r
}\r
+\r
// remove repositories for which user already has a permission\r
- for (RegistrantAccessPermission rp : permissions) {\r
- restricted.remove(rp.registrant);\r
+ if (permissions == null) {\r
+ permissions = new ArrayList<RegistrantAccessPermission>();\r
+ } else {\r
+ for (RegistrantAccessPermission rp : permissions) {\r
+ restricted.remove(rp.registrant);\r
+ }\r
}\r
\r
StringUtils.sortRepositorynames(restricted);\r