try to fix NPE

This commit is contained in:
Anthony Calosa
2023-04-06 07:35:53 +08:00
parent 2ec0d769e5
commit 05814dca15

View File

@@ -74,10 +74,13 @@ public class VStack extends FDropDown {
final Set<ZoneType> zones = new HashSet<>();
playersWithValidTargets = new HashMap<>();
for (final CardView c : activeStackInstance.getTargetCards()) {
if (c.getZone() != null) {
zones.add(c.getZone());
playersWithValidTargets.put(c.getController(), c);
FCollectionView<CardView> targetCards = activeStackInstance.getTargetCards();
if (targetCards != null) {
for (final CardView c : targetCards) {
if (c.getZone() != null) {
zones.add(c.getZone());
playersWithValidTargets.put(c.getController(), c);
}
}
}
if (zones.isEmpty() || playersWithValidTargets.isEmpty()) { return; }