Commit ba35cbb5 authored by swordshine's avatar swordshine

Merge branch 'handsize' into 'master'

Fix NPE when AI discards to hand size

See merge request !1731
parents 3c434aca a93d131e
......@@ -1042,7 +1042,7 @@ public class AiController {
}
public CardCollection getCardsToDiscard(final int numDiscard, final String[] uTypes, final SpellAbility sa, final CardCollectionView exclude) {
boolean noFiltering = "DiscardCMCX".equals(sa.getParam("AILogic")); // list AI logic for which filtering is taken care of elsewhere
boolean noFiltering = (sa != null) && "DiscardCMCX".equals(sa.getParam("AILogic")); // list AI logic for which filtering is taken care of elsewhere
CardCollection hand = new CardCollection(player.getCardsIn(ZoneType.Hand));
hand.removeAll(exclude);
if ((uTypes != null) && (sa != null) && !noFiltering) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment