GroupsService: Remove null from toGroupDto return type

toGroupDto won't return null, as TS's strict mode
prevents group from being nullish

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2021-04-29 18:28:32 +02:00
parent b962e8390a
commit bc08493f89
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3

View file

@ -43,11 +43,7 @@ export class GroupsService {
* @param {Group} group - the group to use
* @return {GroupInfoDto} the built GroupInfoDto
*/
toGroupDto(group: Group | null | undefined): GroupInfoDto | null {
if (!group) {
this.logger.warn(`Recieved ${String(group)} argument!`, 'toGroupDto');
return null;
}
toGroupDto(group: Group): GroupInfoDto {
return {
name: group.name,
displayName: group.displayName,