From ef4dd5703286ed5e6d4781396753517717fb0f9b Mon Sep 17 00:00:00 2001 From: Agetian Date: Fri, 25 Aug 2017 14:59:22 +0000 Subject: [PATCH] - NPE prevention in ComputerUtil. --- forge-ai/src/main/java/forge/ai/ComputerUtil.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/forge-ai/src/main/java/forge/ai/ComputerUtil.java b/forge-ai/src/main/java/forge/ai/ComputerUtil.java index 30717db2797..e2e9d6bc2ef 100644 --- a/forge-ai/src/main/java/forge/ai/ComputerUtil.java +++ b/forge-ai/src/main/java/forge/ai/ComputerUtil.java @@ -1437,6 +1437,7 @@ public class ComputerUtil { } SpellAbility saviorWithSubs = saviour; + ApiType saviorWithSubsApi = saviorWithSubs == null ? null : saviorWithSubs.getApi(); while (saviorWithSubs != null) { ApiType curApi = saviorWithSubs.getApi(); if (curApi == ApiType.Pump || curApi == ApiType.PumpAll) { @@ -1599,8 +1600,7 @@ public class ComputerUtil { && !topStack.hasParam("NoRegen")) || saviourApi == ApiType.ChangeZone || saviourApi == ApiType.Pump || saviourApi == ApiType.PumpAll || saviourApi == ApiType.Protection || saviourApi == null - || saviorWithSubs.getApi() == ApiType.Pump - || saviorWithSubs.getApi() == ApiType.PumpAll)) { + || saviorWithSubsApi == ApiType.Pump || saviorWithSubsApi == ApiType.PumpAll)) { for (final Object o : objects) { if (o instanceof Card) { final Card c = (Card) o;