- Added some null checks.

This commit is contained in:
jeffwadsworth 2012-12-05 14:46:54 -06:00
parent d45aa3ea7b
commit f0bdd6e744

View file

@ -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;
}