mirror of
https://github.com/correl/mage.git
synced 2024-11-15 19:19:33 +00:00
- Added some null checks.
This commit is contained in:
parent
d45aa3ea7b
commit
f0bdd6e744
1 changed files with 7 additions and 3 deletions
|
@ -48,9 +48,13 @@ public class NumberOfTargetsPredicate implements Predicate<MageObject> {
|
|||
@Override
|
||||
public boolean apply(MageObject input, Game game) {
|
||||
Spell spell = game.getStack().getSpell(input.getId());
|
||||
Targets target = spell.getSpellAbility().getTargets();
|
||||
if (target.size() == targets) {
|
||||
return true;
|
||||
if (spell != null) {
|
||||
Targets target = spell.getSpellAbility().getTargets();
|
||||
if (target != null) {
|
||||
if (target.size() == targets) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue