Merge pull request #120 from ilan-schemoul/fix

fix: crash if trying to view game without being a player
This commit is contained in:
evanpelle
2025-03-02 20:02:38 -08:00
committed by GitHub
+3 -2
View File
@@ -387,8 +387,9 @@ export class NameLayer implements Layer {
const existingEmbargo = iconsDiv.querySelector('[data-icon="embargo"]');
const hasEmbargo =
render.player.hasEmbargoAgainst(myPlayer) ||
myPlayer.hasEmbargoAgainst(render.player);
myPlayer &&
(render.player.hasEmbargoAgainst(myPlayer) ||
myPlayer.hasEmbargoAgainst(render.player));
if (myPlayer && hasEmbargo) {
if (!existingEmbargo) {
iconsDiv.appendChild(