diff --git a/src/core/configuration/PastelTheme.ts b/src/core/configuration/PastelTheme.ts index d0bbe5c6d..4527f6162 100644 --- a/src/core/configuration/PastelTheme.ts +++ b/src/core/configuration/PastelTheme.ts @@ -65,8 +65,9 @@ export const pastelTheme = new (class implements Theme { } territoryColor(player: PlayerView): Colord { - if (player.team() !== null) { - return this.teamColor(player.team()); + const team = player.team(); + if (team !== null) { + return this.teamColor(team); } if (player.info().playerType === PlayerType.Human) { return humanColors[simpleHash(player.id()) % humanColors.length]; diff --git a/src/core/configuration/PastelThemeDark.ts b/src/core/configuration/PastelThemeDark.ts index 502af2123..050bfa807 100644 --- a/src/core/configuration/PastelThemeDark.ts +++ b/src/core/configuration/PastelThemeDark.ts @@ -65,8 +65,9 @@ export const pastelThemeDark = new (class implements Theme { } territoryColor(player: PlayerView): Colord { - if (player.team() !== null) { - return this.teamColor(player.team()); + const team = player.team(); + if (team !== null) { + return this.teamColor(team); } if (player.info().playerType === PlayerType.Human) { return humanColors[simpleHash(player.id()) % humanColors.length];