From d3ff285cc55f74351f62f75cda07349de24f2eff Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 30 Jan 2016 10:49:55 +0100 Subject: [PATCH] * Fixed possible null pointer exception for commander cast count. --- .../java/mage/abilities/common/CastCommanderAbility.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Mage/src/main/java/mage/abilities/common/CastCommanderAbility.java b/Mage/src/main/java/mage/abilities/common/CastCommanderAbility.java index b980bd45ca..1a29292735 100644 --- a/Mage/src/main/java/mage/abilities/common/CastCommanderAbility.java +++ b/Mage/src/main/java/mage/abilities/common/CastCommanderAbility.java @@ -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; }