Merge branch 'master' into 'master'

Fix NPE in CostPartWithList (will need further rework / generalization later)

See merge request core-developers/forge!3033
This commit is contained in:
Michael Kamensky
2020-07-26 16:43:40 +00:00

View File

@@ -132,8 +132,8 @@ public abstract class CostPartWithList extends CostPart {
}
cardList.addAll(doListPayment(ability, targetCards));
} else {
if (targetCards.isEmpty()) {
doPayment(ability, null); // e.g. CostFlipCoin
if (targetCards.isEmpty() && this instanceof CostFlipCoin) {
doPayment(ability, null); // TODO: generalize for other cost types if necessary
} else {
for (Card c : targetCards) {
executePayment(ability, c);