mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 13:02:06 -08:00
Fix missing null check in AbilitySourceAttachedPredicate
This commit is contained in:
parent
50940d6b4b
commit
2fbe5bd68c
1 changed files with 4 additions and 2 deletions
|
|
@ -5,6 +5,7 @@ import mage.abilities.Ability;
|
|||
import mage.filter.predicate.ObjectSourcePlayer;
|
||||
import mage.filter.predicate.ObjectSourcePlayerPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.stack.StackAbility;
|
||||
import mage.game.stack.StackObject;
|
||||
|
||||
|
|
@ -18,9 +19,10 @@ public enum AbilitySourceAttachedPredicate implements ObjectSourcePlayerPredicat
|
|||
public boolean apply(ObjectSourcePlayer<StackObject> input, Game game) {
|
||||
MageObject obj = input.getObject();
|
||||
Ability source = input.getSource();
|
||||
Permanent sourcePermanent = source.getSourcePermanentOrLKI(game);
|
||||
|
||||
return obj instanceof StackAbility
|
||||
&& ((StackAbility) obj).getSourceId().equals(source.getSourcePermanentOrLKI(game).getAttachedTo());
|
||||
return sourcePermanent != null && obj instanceof StackAbility
|
||||
&& ((StackAbility) obj).getSourceId().equals(sourcePermanent.getAttachedTo());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue