* Fixed possible null pointer exception for commander cast count.

This commit is contained in:
LevelX2 2016-01-30 10:49:55 +01:00
parent 3f4b322705
commit d3ff285cc5

View file

@ -57,7 +57,11 @@ public class CastCommanderAbility extends SpellAbility {
if (super.activate(game, noMana)) {
// save amount of times commander was cast
Integer castCount = (Integer) game.getState().getValue(sourceId + "_castCount");
castCount++;
if (castCount == null) {
castCount = 1;
} else {
castCount++;
}
game.getState().setValue(sourceId + "_castCount", castCount);
return true;
}