Fixed #4253 (Scythe Specter throw NPE error on 0 cards in opponent hand)

This commit is contained in:
Oleg Agafonov 2017-12-16 03:45:38 +04:00
parent 7a42ea416b
commit d066715693

View file

@ -129,7 +129,8 @@ class ScytheSpecterEffect extends OneShotEffect {
}
for (UUID playerId : game.getOpponents(controller.getId())) {//lose life equal to CMC
if (cardDiscarded.get(playerId).getConvertedManaCost() == highestCMC) {
Card card = cardDiscarded.get(playerId);
if ((card != null) && (card.getConvertedManaCost() == highestCMC)) {
Player opponent = game.getPlayer(playerId);
if (opponent != null
&& discardedCheck.get(playerId) == 1) {//check that card was discarded