Prevent groups from being renamed to empty string

When renaming a group, raise an exception if the new name is
empty.

Bug: Issue 1457
Change-Id: I198e1affa0c04cfcf7433eb44360c145be2d4972
This commit is contained in:
David Pursehouse
2012-07-12 18:12:32 +09:00
committed by Claes Elgemark
parent 754e442efb
commit 212cdc71ed
3 changed files with 11 additions and 3 deletions

View File

@@ -14,6 +14,7 @@
package com.google.gerrit.sshd.commands;
import com.google.gerrit.common.errors.InvalidNameException;
import com.google.gerrit.common.errors.NameAlreadyUsedException;
import com.google.gerrit.common.errors.NoSuchGroupException;
import com.google.gerrit.server.account.PerformRenameGroup;
@@ -39,6 +40,8 @@ public class RenameGroupCommand extends SshCommand {
performRenameGroupFactory.create().renameGroup(groupName, newGroupName);
} catch (OrmException e) {
throw die(e);
} catch (InvalidNameException e) {
throw die(e);
} catch (NameAlreadyUsedException e) {
throw die(e);
} catch (NoSuchGroupException e) {