]> source.dussan.org Git - gitblit.git/commitdiff
Prevent add/edit team with no selected repositories (issue 56)
authorJames Moger <james.moger@gitblit.com>
Fri, 3 Feb 2012 22:23:10 +0000 (17:23 -0500)
committerJames Moger <james.moger@gitblit.com>
Fri, 3 Feb 2012 22:23:10 +0000 (17:23 -0500)
docs/04_releases.mkd
src/com/gitblit/wicket/pages/EditTeamPage.java

index effc94f88de607773cce86e167b9c0af770eb00b..c8e9d1975f957cd50e9e667e7b6eb7bf395a1d24 100644 (file)
@@ -14,6 +14,7 @@
 \r
 #### fixes \r
 \r
+- Prevent add/edit team with no selected repositories (issue 56) \r
 - Disallow browser autocomplete on add/edit user/team/repository pages\r
 - Fixed username case-sensitivity issues (issue 43)\r
 - Disregard searching a subfolder if Gitblit does not have filesystem permissions (Github/lemval issue 51)\r
index 0af3cb4ec8c7ce8808f2081b713ac166031475e8..d78f889ef72afb44c4f4a23c1ef3b54ce370718a 100644 (file)
@@ -150,6 +150,10 @@ public class EditTeamPage extends RootSubPage {
                                while (selectedRepositories.hasNext()) {\r
                                        repos.add(selectedRepositories.next().toLowerCase());\r
                                }\r
+                               if (repos.size() == 0) {\r
+                                       error("A team must specify at least one repository.");\r
+                                       return;\r
+                               }\r
                                teamModel.repositories.clear();\r
                                teamModel.repositories.addAll(repos);\r
 \r