- Fixed a NPE in ComputerUtilCost.

This commit is contained in:
Agetian
2017-08-25 10:59:29 +00:00
parent 909b8e7127
commit 2ba53e2dab

View File

@@ -92,9 +92,11 @@ public class ComputerUtilCost {
// Remove X counters - set ChosenX to max possible value here, the SAs should correct that
// value later as the AI decides what to do (in checkApiLogic / checkAiLogic)
final String sVar = sa.getSVar(remCounter.getAmount());
if (sVar.equals("XChoice")) {
sa.setSVar("ChosenX", String.valueOf(source.getCounters(type)));
if (sa.hasSVar(remCounter.getAmount())) {
final String sVar = sa.getSVar(remCounter.getAmount());
if (sVar.equals("XChoice")) {
sa.setSVar("ChosenX", String.valueOf(source.getCounters(type)));
}
}
// check the sa what the PaymentDecision is.