mirror of
https://github.com/magefree/mage.git
synced 2026-01-25 04:39:18 -08:00
Fixed some more possible null pointer exceptions.
This commit is contained in:
parent
7e9d285a49
commit
e74f5995cb
6 changed files with 20 additions and 11 deletions
|
|
@ -218,7 +218,9 @@ class TawnossCoffinReturnEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
ExileZone exileZone = game.getExile().getExileZone(source.getSourceId());
|
||||
|
||||
if (exileZone == null) {
|
||||
return true;
|
||||
}
|
||||
FilterCard filter = new FilterCard();
|
||||
filter.add(new CardTypePredicate(CardType.CREATURE));
|
||||
//There should be only 1 there, but the for each loop seems the most practical to get to it
|
||||
|
|
|
|||
|
|
@ -244,8 +244,8 @@ class JestersScepterCounterEffect extends OneShotEffect {
|
|||
String nameOfExiledCardPayment = (String) game.getState().getValue(source.getSourceId() + "_nameOfExiledCardPayment");
|
||||
String nameOfExiledCardPayment2 = (String) game.getState().getValue(source.getSourceId() + "_nameOfExiledCardPayment2");
|
||||
if (nameOfExiledCardPayment != null) {
|
||||
if (nameOfExiledCardPayment.matches(spell.getName())
|
||||
|| nameOfExiledCardPayment2.matches(spell.getName())) {
|
||||
if (nameOfExiledCardPayment.equals(spell.getCard().getName())
|
||||
|| (nameOfExiledCardPayment2 != null) && nameOfExiledCardPayment2.equals(spell.getCard().getName())) {
|
||||
return game.getStack().counter(targetPointer.getFirst(game, source), source.getSourceId(), game);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -119,7 +119,10 @@ class EpicExperimentEffect extends OneShotEffect {
|
|||
}
|
||||
}
|
||||
// move cards not cast to graveyard
|
||||
controller.moveCards(game.getExile().getExileZone(source.getSourceId()).getCards(game), Zone.GRAVEYARD, source, game);
|
||||
ExileZone exileZone = game.getExile().getExileZone(source.getSourceId());
|
||||
if (exileZone != null) {
|
||||
controller.moveCards(exileZone.getCards(game), Zone.GRAVEYARD, source, game);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ class InfernoTrapCondition implements Condition {
|
|||
InfernoTrapWatcher watcher = (InfernoTrapWatcher) game.getState().getWatchers().get(InfernoTrapWatcher.class.getName());
|
||||
if (watcher != null) {
|
||||
Set<MageObjectReference> damagingCreatures = watcher.getDamagingCreatures(source.getControllerId());
|
||||
return !damagingCreatures.isEmpty() && damagingCreatures.size() > 1;
|
||||
return damagingCreatures != null && damagingCreatures.size() > 1;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue