forked from External/mage
fixed some NPEs
This commit is contained in:
parent
d85bd073c7
commit
5023d13525
3 changed files with 7 additions and 4 deletions
|
|
@ -689,8 +689,11 @@ public class ComputerPlayer2 extends ComputerPlayer<ComputerPlayer2> 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());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue