* Kheru Spellsnatcher - Fixed possible null pointer exception.

This commit is contained in:
LevelX2 2014-12-01 09:59:15 +01:00
parent ea9687e740
commit 29d8873350

View file

@ -152,7 +152,12 @@ 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())) {
if (getTargetPointer().getFirst(game, source) == null) {
this.discard();
return false;
}
if (sourceId.equals(getTargetPointer().getFirst(game, source))) {
Card card = game.getCard(sourceId); Card card = game.getCard(sourceId);
if (card != null) { if (card != null) {
if (game.getState().getZone(sourceId) == Zone.EXILED) { if (game.getState().getZone(sourceId) == Zone.EXILED) {
@ -165,6 +170,7 @@ class KheruSpellsnatcherCastFromExileEffect extends AsThoughEffectImpl {
} }
} }
} }
}
return false; return false;
} }
} }