From 2afc3115949c774bc6f35889f4e42439cc2106e0 Mon Sep 17 00:00:00 2001 From: James Moger Date: Fri, 3 Feb 2012 17:23:10 -0500 Subject: [PATCH] Prevent add/edit team with no selected repositories (issue 56) --- docs/04_releases.mkd | 1 + src/com/gitblit/wicket/pages/EditTeamPage.java | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/docs/04_releases.mkd b/docs/04_releases.mkd index effc94f8..c8e9d197 100644 --- a/docs/04_releases.mkd +++ b/docs/04_releases.mkd @@ -14,6 +14,7 @@ #### fixes +- Prevent add/edit team with no selected repositories (issue 56) - Disallow browser autocomplete on add/edit user/team/repository pages - Fixed username case-sensitivity issues (issue 43) - Disregard searching a subfolder if Gitblit does not have filesystem permissions (Github/lemval issue 51) diff --git a/src/com/gitblit/wicket/pages/EditTeamPage.java b/src/com/gitblit/wicket/pages/EditTeamPage.java index 0af3cb4e..d78f889e 100644 --- a/src/com/gitblit/wicket/pages/EditTeamPage.java +++ b/src/com/gitblit/wicket/pages/EditTeamPage.java @@ -150,6 +150,10 @@ public class EditTeamPage extends RootSubPage { while (selectedRepositories.hasNext()) { repos.add(selectedRepositories.next().toLowerCase()); } + if (repos.size() == 0) { + error("A team must specify at least one repository."); + return; + } teamModel.repositories.clear(); teamModel.repositories.addAll(repos); -- 2.39.5