UsersService: Add null check to toUserDto() converter

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2020-09-22 17:28:57 +02:00
parent 9cae7e34dc
commit 615bd6496b
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3

View file

@ -31,6 +31,10 @@ export class UsersService {
this.logger.warn('toUserDto recieved undefined argument!');
return null;
}
if (user === null) {
this.logger.warn('toUserDto recieved null argument!');
return null;
}
return {
userName: user.userName,
displayName: user.displayName,