AbilityUtils: don't crash when CardTrait is null

This commit is contained in:
Hans Mackowiak
2021-03-18 13:37:05 +01:00
parent fc5557a137
commit 0d81961325
19 changed files with 57 additions and 133 deletions

View File

@@ -1606,7 +1606,7 @@ public class AbilityUtils {
final String s2 = AbilityUtils.applyAbilityTextChangeEffects(s, ctb);
final String[] l = s2.split("/");
final String expr = CardFactoryUtil.extractOperators(s2);
final Player player = ctb instanceof SpellAbility ? ((SpellAbility)ctb).getActivatingPlayer() : ctb.getHostCard().getController();
final Player player = ctb == null ? null : ctb instanceof SpellAbility ? ((SpellAbility)ctb).getActivatingPlayer() : ctb.getHostCard().getController();
final String[] sq;
sq = l[0].split("\\.");