mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 13:50:43 +00:00
bugfix: add null check on trade ship target in alternate view
This commit is contained in:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user