mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-07-04 09:28:06 +02:00
Fix creating a repository permission without a name breaking the repository (#2126)
If a POST request is submitted to the rest api for repostory permissions, the regex validator ignores the name field if it is null, which leads to an internal server error and breaks any further attempts to interact with that repository. An additional not-null constraint resolves this problem.
This commit is contained in:
committed by
GitHub
parent
42bdd1d22e
commit
fe82c967b8
@@ -33,6 +33,7 @@ import lombok.ToString;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import sonia.scm.util.ValidationUtil;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Pattern;
|
||||
|
||||
import java.util.Collection;
|
||||
@@ -43,6 +44,7 @@ public class RepositoryPermissionDto extends HalRepresentation implements Update
|
||||
|
||||
public static final String GROUP_PREFIX = "@";
|
||||
|
||||
@NotNull
|
||||
@Pattern(regexp = ValidationUtil.REGEX_NAME)
|
||||
private String name;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user