mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
Prevent possible NPE in AI code.
This commit is contained in:
@@ -632,11 +632,13 @@ public class PlayerControllerAi extends PlayerController {
|
|||||||
}
|
}
|
||||||
Card toSave = hostsa == null ? sa.getTargetCard() : hostsa.getTargetCard();
|
Card toSave = hostsa == null ? sa.getTargetCard() : hostsa.getTargetCard();
|
||||||
CardCollection threats = null;
|
CardCollection threats = null;
|
||||||
if (combat.isBlocked(toSave)) {
|
if (toSave != null) {
|
||||||
threats = combat.getBlockers(toSave);
|
if (combat.isBlocked(toSave)) {
|
||||||
}
|
threats = combat.getBlockers(toSave);
|
||||||
if (combat.isBlocking(toSave)) {
|
}
|
||||||
threats = combat.getAttackersBlockedBy(toSave);
|
if (combat.isBlocking(toSave)) {
|
||||||
|
threats = combat.getAttackersBlockedBy(toSave);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (threats != null) {
|
if (threats != null) {
|
||||||
ComputerUtilCard.sortByEvaluateCreature(threats);
|
ComputerUtilCard.sortByEvaluateCreature(threats);
|
||||||
|
|||||||
Reference in New Issue
Block a user