mirror of
https://github.com/correl/mage.git
synced 2024-11-15 19:19:33 +00:00
Merge pull request #1837 from spjspj/master
Fix possible NPE for Martyr's Bond
This commit is contained in:
commit
635f0244dd
1 changed files with 4 additions and 4 deletions
|
@ -141,9 +141,9 @@ class MartyrsBondEffect extends OneShotEffect {
|
|||
Card sourceCard = game.getCard(source.getSourceId());
|
||||
Permanent saccedPermanent = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source));
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null && sourceCard != null) {
|
||||
if (controller != null && sourceCard != null && saccedPermanent != null) {
|
||||
FilterControlledPermanent filter = new FilterControlledPermanent();
|
||||
String message = "permanent with a type (";
|
||||
String message = "permanent with type (";
|
||||
boolean firstType = true;
|
||||
|
||||
ArrayList<CardTypePredicate> cardTypes = new ArrayList<>();
|
||||
|
@ -154,7 +154,7 @@ class MartyrsBondEffect extends OneShotEffect {
|
|||
message += type;
|
||||
firstType = false;
|
||||
} else {
|
||||
message += ", " + type;
|
||||
message += " or " + type;
|
||||
}
|
||||
}
|
||||
message += ") to sacrifice";
|
||||
|
@ -177,9 +177,9 @@ class MartyrsBondEffect extends OneShotEffect {
|
|||
Permanent permanent = game.getPermanent(permID);
|
||||
if (permanent != null) {
|
||||
permanent.sacrifice(source.getSourceId(), game);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
|
Loading…
Reference in a new issue