* Fixed possible exception when planswalker were removed from battlefield.

This commit is contained in:
LevelX2 2016-03-07 16:28:24 +01:00
parent 60faf6378a
commit bd43cf0e1e

View file

@ -830,8 +830,7 @@ public class Combat implements Serializable, Copyable<Combat> {
blockIsValid = true;
break CombatGroups;
} else // check if the blocker blocks a attacker that must be blocked at least by one and is the only blocker, this block is also valid
{
if (combatGroup.getBlockers().size() == 1) {
if (combatGroup.getBlockers().size() == 1) {
if (mustBeBlockedByAtLeastOne.containsKey(forcingAttackerId)) {
if (mustBeBlockedByAtLeastOne.get(forcingAttackerId).contains(creatureForcedToBlock.getId())) {
blockIsValid = true;
@ -839,7 +838,6 @@ public class Combat implements Serializable, Copyable<Combat> {
}
}
}
}
}
}
}
@ -1113,7 +1111,7 @@ public class Combat implements Serializable, Copyable<Combat> {
public boolean removePlaneswalkerFromCombat(UUID planeswalkerId, Game game, boolean withInfo) {
boolean result = false;
for (CombatGroup group : groups) {
if (group.getDefenderId().equals(planeswalkerId)) {
if (group.getDefenderId() != null && group.getDefenderId().equals(planeswalkerId)) {
group.removeAttackedPlaneswalker(planeswalkerId);
result = true;
}