fix: crash if trying to view game without being a player

This commit is contained in:
ilan schemoul
2025-03-02 22:52:42 +01:00
parent db3f62d0b1
commit 0372abe548
+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(