mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-12 08:25:44 +01:00
Add null check
This commit is contained in:
@@ -62,6 +62,9 @@ public class GroupCollectionResource extends AbstractManagerResource<Group, Grou
|
||||
@TypeHint(TypeHint.NO_CONTENT.class)
|
||||
@Consumes(VndMediaType.GROUP)
|
||||
public Response create(@Context UriInfo uriInfo, GroupDto groupDto) throws IOException, GroupException {
|
||||
if (groupDto == null) {
|
||||
return Response.status(400).build();
|
||||
}
|
||||
Group group = dtoToGroupMapper.map(groupDto);
|
||||
manager.create(group);
|
||||
return Response.created(URI.create(group(uriInfo).self(group.getName()))).build();
|
||||
|
||||
Reference in New Issue
Block a user