diff --git a/gemp-lotr/gemp-lotr-async/src/main/web/cards/set9-1.json b/gemp-lotr/gemp-lotr-async/src/main/web/cards/set9-1.json index 98cbaa7f5..9ca1b7a32 100644 --- a/gemp-lotr/gemp-lotr-async/src/main/web/cards/set9-1.json +++ b/gemp-lotr/gemp-lotr-async/src/main/web/cards/set9-1.json @@ -322,7 +322,8 @@ "filter": "choose(dwarf)", "count": { "type": "forEachKeywordOnCardInMemory", - "memory": "spottedDwarf" + "memory": "spottedDwarf", + "keyword": "damage" } }, { diff --git a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/cards/build/BuiltLotroCardBlueprint.java b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/cards/build/BuiltLotroCardBlueprint.java index e2ee818ec..bbcfccc11 100644 --- a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/cards/build/BuiltLotroCardBlueprint.java +++ b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/cards/build/BuiltLotroCardBlueprint.java @@ -425,7 +425,7 @@ public class BuiltLotroCardBlueprint implements LotroCardBlueprint { DefaultActionContext actionContext = new DefaultActionContext(playerId, game, self, null, null); final PhysicalCard firstActive = Filters.findFirstActive(game, copiedFilter.getFilterable(actionContext)); if (firstActive != null) - activatedActions.addAll(firstActive.getBlueprint().getPhaseActionsInPlay(playerId, game, self)); + addAllNotNull(activatedActions, firstActive.getBlueprint().getPhaseActionsInPlay(playerId, game, self)); } } return activatedActions; @@ -445,13 +445,19 @@ public class BuiltLotroCardBlueprint implements LotroCardBlueprint { for (FilterableSource copiedFilter : copiedFilters) { DefaultActionContext actionContext = new DefaultActionContext(self.getOwner(), game, self, null, null); final PhysicalCard firstActive = Filters.findFirstActive(game, copiedFilter.getFilterable(actionContext)); - if (firstActive != null) - modifiers.addAll(firstActive.getBlueprint().getInPlayModifiers(game, self)); + if (firstActive != null) { + addAllNotNull(modifiers, firstActive.getBlueprint().getInPlayModifiers(game, self)); + } } } return modifiers; } + private void addAllNotNull(List list, List possiblyNullList) { + if (possiblyNullList != null) + list.addAll(possiblyNullList); + } + @Override public List getStackedOnModifiers(LotroGame game, PhysicalCard self) { return getModifiers(game, self, stackedOnModifiers); @@ -528,7 +534,7 @@ public class BuiltLotroCardBlueprint implements LotroCardBlueprint { DefaultActionContext actionContext = new DefaultActionContext(self.getOwner(), game, self, null, effect); final PhysicalCard firstActive = Filters.findFirstActive(game, copiedFilter.getFilterable(actionContext)); if (firstActive != null) - result.addAll(firstActive.getBlueprint().getRequiredBeforeTriggers(game, effect, self)); + addAllNotNull(result, firstActive.getBlueprint().getRequiredBeforeTriggers(game, effect, self)); } } @@ -558,7 +564,7 @@ public class BuiltLotroCardBlueprint implements LotroCardBlueprint { DefaultActionContext actionContext = new DefaultActionContext(self.getOwner(), game, self, effectResult, null); final PhysicalCard firstActive = Filters.findFirstActive(game, copiedFilter.getFilterable(actionContext)); if (firstActive != null) - result.addAll(firstActive.getBlueprint().getRequiredAfterTriggers(game, effectResult, self)); + addAllNotNull(result, firstActive.getBlueprint().getRequiredAfterTriggers(game, effectResult, self)); } } @@ -588,7 +594,7 @@ public class BuiltLotroCardBlueprint implements LotroCardBlueprint { DefaultActionContext actionContext = new DefaultActionContext(playerId, game, self, null, effect); final PhysicalCard firstActive = Filters.findFirstActive(game, copiedFilter.getFilterable(actionContext)); if (firstActive != null) - result.addAll(firstActive.getBlueprint().getOptionalBeforeTriggers(playerId, game, effect, self)); + addAllNotNull(result, firstActive.getBlueprint().getOptionalBeforeTriggers(playerId, game, effect, self)); } } @@ -618,7 +624,7 @@ public class BuiltLotroCardBlueprint implements LotroCardBlueprint { DefaultActionContext actionContext = new DefaultActionContext(playerId, game, self, effectResult, null); final PhysicalCard firstActive = Filters.findFirstActive(game, copiedFilter.getFilterable(actionContext)); if (firstActive != null) - result.addAll(firstActive.getBlueprint().getOptionalAfterTriggers(playerId, game, effectResult, self)); + addAllNotNull(result, firstActive.getBlueprint().getOptionalAfterTriggers(playerId, game, effectResult, self)); } } @@ -648,7 +654,7 @@ public class BuiltLotroCardBlueprint implements LotroCardBlueprint { DefaultActionContext actionContext = new DefaultActionContext(playerId, game, self, null, effect); final PhysicalCard firstActive = Filters.findFirstActive(game, copiedFilter.getFilterable(actionContext)); if (firstActive != null) - result.addAll(firstActive.getBlueprint().getOptionalInPlayBeforeActions(playerId, game, effect, self)); + addAllNotNull(result, firstActive.getBlueprint().getOptionalInPlayBeforeActions(playerId, game, effect, self)); } } @@ -678,7 +684,7 @@ public class BuiltLotroCardBlueprint implements LotroCardBlueprint { DefaultActionContext actionContext = new DefaultActionContext(playerId, game, self, effectResult, null); final PhysicalCard firstActive = Filters.findFirstActive(game, copiedFilter.getFilterable(actionContext)); if (firstActive != null) - result.addAll(firstActive.getBlueprint().getOptionalInPlayAfterActions(playerId, game, effectResult, self)); + addAllNotNull(result, firstActive.getBlueprint().getOptionalInPlayAfterActions(playerId, game, effectResult, self)); } } diff --git a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/cards/build/field/effect/appender/resolver/ValueResolver.java b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/cards/build/field/effect/appender/resolver/ValueResolver.java index 3772d012a..6cd859ba0 100644 --- a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/cards/build/field/effect/appender/resolver/ValueResolver.java +++ b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/cards/build/field/effect/appender/resolver/ValueResolver.java @@ -114,6 +114,8 @@ public class ValueResolver { FieldUtils.validateAllowedFields(object, "memory", "keyword"); final String memory = FieldUtils.getString(object.get("memory"), "memory"); final Keyword keyword = FieldUtils.getEnum(Keyword.class, object.get("keyword"), "keyword"); + if (keyword == null) + throw new InvalidCardDefinitionException("Keyword cannot be null"); return (actionContext) -> { final LotroGame game = actionContext.getGame(); int count = 0;