mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-12 16:35:45 +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)
|
@TypeHint(TypeHint.NO_CONTENT.class)
|
||||||
@Consumes(VndMediaType.GROUP)
|
@Consumes(VndMediaType.GROUP)
|
||||||
public Response create(@Context UriInfo uriInfo, GroupDto groupDto) throws IOException, GroupException {
|
public Response create(@Context UriInfo uriInfo, GroupDto groupDto) throws IOException, GroupException {
|
||||||
|
if (groupDto == null) {
|
||||||
|
return Response.status(400).build();
|
||||||
|
}
|
||||||
Group group = dtoToGroupMapper.map(groupDto);
|
Group group = dtoToGroupMapper.map(groupDto);
|
||||||
manager.create(group);
|
manager.create(group);
|
||||||
return Response.created(URI.create(group(uriInfo).self(group.getName()))).build();
|
return Response.created(URI.create(group(uriInfo).self(group.getName()))).build();
|
||||||
|
|||||||
Reference in New Issue
Block a user