mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
* Kheru Spellsnatcher - Fixed possible null pointer exception.
This commit is contained in:
parent
ea9687e740
commit
29d8873350
1 changed files with 16 additions and 10 deletions
|
@ -152,16 +152,22 @@ class KheruSpellsnatcherCastFromExileEffect extends AsThoughEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) {
|
public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) {
|
||||||
if (getTargetPointer().getFirst(game, source).equals(sourceId) && affectedControllerId.equals(source.getControllerId())) {
|
if (affectedControllerId.equals(source.getControllerId())) {
|
||||||
Card card = game.getCard(sourceId);
|
if (getTargetPointer().getFirst(game, source) == null) {
|
||||||
if (card != null) {
|
this.discard();
|
||||||
if (game.getState().getZone(sourceId) == Zone.EXILED) {
|
return false;
|
||||||
Player player = game.getPlayer(affectedControllerId);
|
}
|
||||||
player.setCastSourceIdWithoutMana(sourceId);
|
if (sourceId.equals(getTargetPointer().getFirst(game, source))) {
|
||||||
return true;
|
Card card = game.getCard(sourceId);
|
||||||
}
|
if (card != null) {
|
||||||
else {
|
if (game.getState().getZone(sourceId) == Zone.EXILED) {
|
||||||
this.discard();
|
Player player = game.getPlayer(affectedControllerId);
|
||||||
|
player.setCastSourceIdWithoutMana(sourceId);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.discard();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue