mirror of
https://github.com/correl/mage.git
synced 2024-11-22 03:00:11 +00:00
Guardian Project - fixed game error on usage (NPE, closes #10055)
This commit is contained in:
parent
0ce6df9ef7
commit
8322d75fc0
1 changed files with 4 additions and 5 deletions
|
@ -67,7 +67,7 @@ class GuardianProjectTriggeredAbility extends EntersBattlefieldAllTriggeredAbili
|
|||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget();
|
||||
if (!filter.match(permanent, controllerId, this, game)) {
|
||||
if (permanent == null || !filter.match(permanent, controllerId, this, game)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -133,12 +133,11 @@ class GuardianProjectEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player == null) {
|
||||
Permanent permanent = mor.getPermanentOrLKIBattlefield(game);
|
||||
if (player == null || permanent == null) {
|
||||
return false;
|
||||
}
|
||||
if (GuardianProjectTriggeredAbility.checkCondition(
|
||||
mor.getPermanentOrLKIBattlefield(game), source.getControllerId(), game)
|
||||
) {
|
||||
if (GuardianProjectTriggeredAbility.checkCondition(permanent, source.getControllerId(), game)) {
|
||||
player.drawCards(1, source, game);
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue