diff --git a/src/core/game/GameView.ts b/src/core/game/GameView.ts index c50c9874b..de56f49b6 100644 --- a/src/core/game/GameView.ts +++ b/src/core/game/GameView.ts @@ -112,7 +112,7 @@ export class UnitView { } export class PlayerView { - public anonymousName: string; + public anonymousName: string | null = null; constructor( private game: GameView, @@ -122,8 +122,10 @@ export class PlayerView { if (data.clientID === game.myClientID()) { this.anonymousName = this.data.name; } else { - this.anonymousName = - createRandomName(this.data.name, this.data.playerType) ?? ""; + this.anonymousName = createRandomName( + this.data.name, + this.data.playerType, + ); } }