fix: change sessionstate type to prevent unset values

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Tilman Vatteroth 2023-03-19 22:04:28 +01:00
parent f78fd69bf4
commit 229d4a4a1d
6 changed files with 26 additions and 27 deletions

View file

@ -110,6 +110,9 @@ export class WebsocketGateway implements OnGatewayConnection {
const username = await this.sessionService.fetchUsernameForSessionId(
sessionId.get(),
);
if (username === undefined) {
return null;
}
return await this.userService.getUserByUsername(username);
}
}