mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-23 18:26:32 -05:00
UsersService: Merge if-statements and add null
to return type in toUserDto
Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
a028dac448
commit
8fada8809c
1 changed files with 3 additions and 7 deletions
|
@ -26,13 +26,9 @@ export class UsersService {
|
|||
}
|
||||
}
|
||||
|
||||
toUserDto(user: User): UserInfoDto {
|
||||
if (user === undefined) {
|
||||
this.logger.warn('toUserDto recieved undefined argument!');
|
||||
return null;
|
||||
}
|
||||
if (user === null) {
|
||||
this.logger.warn('toUserDto recieved null argument!');
|
||||
toUserDto(user: User | null | undefined): UserInfoDto | null {
|
||||
if (!user) {
|
||||
this.logger.warn(`toUserDto recieved ${user} argument!`);
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
|
|
Loading…
Reference in a new issue