diff --git a/Mage.Server.Plugins/Mage.Player.AIMinimax/src/mage/player/ai/ComputerPlayer2.java b/Mage.Server.Plugins/Mage.Player.AIMinimax/src/mage/player/ai/ComputerPlayer2.java index b8b3c1bdc60..f2c0e787658 100644 --- a/Mage.Server.Plugins/Mage.Player.AIMinimax/src/mage/player/ai/ComputerPlayer2.java +++ b/Mage.Server.Plugins/Mage.Player.AIMinimax/src/mage/player/ai/ComputerPlayer2.java @@ -689,8 +689,11 @@ public class ComputerPlayer2 extends ComputerPlayer implements UUID opponentId = game.getCombat().getDefenders().iterator().next(); for (UUID attackerId: combat.getAttackers()) { this.declareAttacker(attackerId, opponentId, game); - if (logger.isDebugEnabled()) - logger.debug("attacking with:" + game.getPermanent(attackerId).getName()); + if (logger.isDebugEnabled()) { + Permanent p = game.getPermanent(attackerId); + if (p != null) + logger.debug("attacking with:" + p.getName()); + } } } } diff --git a/Mage.Server/src/main/java/mage/server/TableManager.java b/Mage.Server/src/main/java/mage/server/TableManager.java index 517060b087f..776065ded88 100644 --- a/Mage.Server/src/main/java/mage/server/TableManager.java +++ b/Mage.Server/src/main/java/mage/server/TableManager.java @@ -219,7 +219,7 @@ public class TableManager { controllers.remove(tableId); tables.remove(tableId); GamesRoomManager.getInstance().removeTable(tableId); - if (table.getMatch().getGame() != null) + if (table.getMatch() != null && table.getMatch().getGame() != null) table.getMatch().getGame().end(); } } diff --git a/Mage/src/mage/abilities/condition/common/EnchantedCondition.java b/Mage/src/mage/abilities/condition/common/EnchantedCondition.java index f97d4f633af..242411cf0fa 100644 --- a/Mage/src/mage/abilities/condition/common/EnchantedCondition.java +++ b/Mage/src/mage/abilities/condition/common/EnchantedCondition.java @@ -52,7 +52,7 @@ public class EnchantedCondition implements Condition { if (permanent != null) { for (UUID uuid : permanent.getAttachments()) { Permanent attached = game.getBattlefield().getPermanent(uuid); - if (attached.getCardType().contains(CardType.ENCHANTMENT)) { + if (attached != null && attached.getCardType().contains(CardType.ENCHANTMENT)) { return true; } }