mirror of
https://github.com/correl/mage.git
synced 2025-01-12 19:25:44 +00:00
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:
parent
3870a1e522
commit
3eae5e9a00
1 changed files with 4 additions and 0 deletions
|
@ -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());
|
||||
|
|
Loading…
Reference in a new issue