mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
- Some NPE protection for getAttackingBands
This commit is contained in:
@@ -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());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user