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>
This commit is contained in:
Scott Anderson
2025-05-18 13:50:08 -04:00
committed by GitHub
parent 95e0e9fa33
commit 1ebf6d4fab
+5 -3
View File
@@ -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,
);
}
}