* Anthroplasm - Fixed possible null pointer exception.

This commit is contained in:
LevelX2 2017-09-13 17:05:09 +02:00
parent f65cf063ea
commit 55917ccc63
2 changed files with 13 additions and 12 deletions

View file

@ -53,7 +53,7 @@ import mage.game.permanent.Permanent;
public class Anthroplasm extends CardImpl {
public Anthroplasm(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{U}{U}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}{U}");
this.subtype.add(SubType.SHAPESHIFTER);
this.power = new MageInt(0);
@ -65,7 +65,7 @@ public class Anthroplasm extends CardImpl {
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AnthroplasmEffect(), new ManaCostsImpl("{X}"));
ability.addCost(new TapSourceCost());
this.addAbility(ability);
}
public Anthroplasm(final Anthroplasm card) {
@ -80,12 +80,12 @@ public class Anthroplasm extends CardImpl {
class AnthroplasmEffect extends OneShotEffect {
AnthroplasmEffect ( ) {
AnthroplasmEffect() {
super(Outcome.Benefit);
staticText = "Remove all +1/+1 counters from Anthroplasm and put X +1/+1 counters on it";
staticText = "Remove all +1/+1 counters from {this} and put X +1/+1 counters on it";
}
AnthroplasmEffect ( AnthroplasmEffect effect ) {
AnthroplasmEffect(AnthroplasmEffect effect) {
super(effect);
}

View file

@ -27,6 +27,11 @@
*/
package mage.cards;
import java.lang.reflect.Constructor;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;
import mage.MageObject;
import mage.MageObjectImpl;
import mage.Mana;
@ -48,12 +53,6 @@ import mage.util.SubTypeList;
import mage.watchers.Watcher;
import org.apache.log4j.Logger;
import java.lang.reflect.Constructor;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;
public abstract class CardImpl extends MageObjectImpl implements Card {
private static final long serialVersionUID = 1L;
@ -669,7 +668,9 @@ public abstract class CardImpl extends MageObjectImpl implements Card {
@Override
public void removeCounters(Counter counter, Game game) {
removeCounters(counter.getName(), counter.getCount(), game);
if (counter != null) {
removeCounters(counter.getName(), counter.getCount(), game);
}
}
@Override