From 1ebf6d4fabe610551ea7e97461afe43f77408bde Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Sun, 18 May 2025 13:50:08 -0400 Subject: [PATCH] bug: anon names (#795) ## Description: Fix a bad conflict resolution from enabling `strictNullChecks`. ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced - [x] I understand that submitting code with bugs that could have been caught through manual testing blocks releases and new features for all contributors Co-authored-by: Scott Anderson <662325+scottanderson@users.noreply.github.com> --- src/core/game/GameView.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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, + ); } }