bugfix: add null check on trade ship target in alternate view

This commit is contained in:
evan
2025-04-24 08:14:06 -07:00
parent e86e4d581c
commit 34333e306f
+1 -1
View File
@@ -429,7 +429,7 @@ export class UnitLayer implements Layer {
if (unit.type() == UnitType.TradeShip && unit.dstPortId() != null) {
const target = this.game.unit(unit.dstPortId())?.owner();
const myPlayer = this.game.myPlayer();
if (myPlayer != null) {
if (myPlayer != null && target != null) {
if (myPlayer == target) {
rel = Relationship.Self;
} else if (myPlayer.isFriendly(target)) {