Fixed a bug of the copy effect that could lead to null pointer exceptions e.g. for Permeating Mass trying to copy meanwhile removed target(fixes #2342).

This commit is contained in:
LevelX2 2016-09-22 20:49:12 +02:00
parent 3870a1e522
commit 3eae5e9a00

View file

@ -104,6 +104,10 @@ public class CopyEffect extends ContinuousEffectImpl {
@Override
public boolean apply(Game game, Ability source) {
if (affectedObjectList.isEmpty()) {
this.discard();
return false;
}
Permanent permanent = affectedObjectList.get(0).getPermanent(game);
if (permanent == null) {
permanent = (Permanent) game.getLastKnownInformation(getSourceId(), Zone.BATTLEFIELD, source.getSourceObjectZoneChangeCounter());