- NPE prevention in ComputerUtil.

This commit is contained in:
Agetian
2017-08-25 14:59:22 +00:00
parent ad1e17f329
commit ef4dd57032

View File

@@ -1437,6 +1437,7 @@ public class ComputerUtil {
} }
SpellAbility saviorWithSubs = saviour; SpellAbility saviorWithSubs = saviour;
ApiType saviorWithSubsApi = saviorWithSubs == null ? null : saviorWithSubs.getApi();
while (saviorWithSubs != null) { while (saviorWithSubs != null) {
ApiType curApi = saviorWithSubs.getApi(); ApiType curApi = saviorWithSubs.getApi();
if (curApi == ApiType.Pump || curApi == ApiType.PumpAll) { if (curApi == ApiType.Pump || curApi == ApiType.PumpAll) {
@@ -1599,8 +1600,7 @@ public class ComputerUtil {
&& !topStack.hasParam("NoRegen")) || saviourApi == ApiType.ChangeZone && !topStack.hasParam("NoRegen")) || saviourApi == ApiType.ChangeZone
|| saviourApi == ApiType.Pump || saviourApi == ApiType.PumpAll || saviourApi == ApiType.Pump || saviourApi == ApiType.PumpAll
|| saviourApi == ApiType.Protection || saviourApi == null || saviourApi == ApiType.Protection || saviourApi == null
|| saviorWithSubs.getApi() == ApiType.Pump || saviorWithSubsApi == ApiType.Pump || saviorWithSubsApi == ApiType.PumpAll)) {
|| saviorWithSubs.getApi() == ApiType.PumpAll)) {
for (final Object o : objects) { for (final Object o : objects) {
if (o instanceof Card) { if (o instanceof Card) {
final Card c = (Card) o; final Card c = (Card) o;