- Some NPE protection for getAttackingBands

This commit is contained in:
Sol
2015-11-22 20:51:25 +00:00
parent 1e546f1ec8
commit 6dfec39143

View File

@@ -159,6 +159,8 @@ public class Combat {
public final CardCollection getAttackersOf(GameEntity defender) { public final CardCollection getAttackersOf(GameEntity defender) {
CardCollection result = new CardCollection(); CardCollection result = new CardCollection();
if (!attackedByBands.containsKey(defender))
return result;
for (AttackingBand v : attackedByBands.get(defender)) { for (AttackingBand v : attackedByBands.get(defender)) {
result.addAll(v.getAttackers()); result.addAll(v.getAttackers());
} }