- Fixed a miscalculation and related NPE when trying to predict the bonus from Arahbo, Roar of the World.

- Some extra NPE prevention measures in related trigger processing code.
This commit is contained in:
Agetian
2017-08-16 12:25:23 +00:00
parent 870b168cea
commit d53f9e99af
4 changed files with 9 additions and 2 deletions

View File

@@ -824,6 +824,9 @@ public class Card extends GameEntity implements Comparable<Card> {
if (!currentState.getTriggers().isEmpty()) {
for (final Trigger t : currentState.getTriggers()) {
final SpellAbility sa = t.getTriggeredSA();
if (sa == null) {
continue;
}
triggered = sa.hasTriggeringObject(typeIn) ? sa.getTriggeringObject(typeIn) : null;
if (triggered != null) {
break;

View File

@@ -656,7 +656,7 @@ public class CardFactoryUtil {
* @return a int.
*/
public static int xCount(final Card c, final String expression) {
if (StringUtils.isBlank(expression)) {
if (StringUtils.isBlank(expression) || c == null) {
return 0;
}
if (StringUtils.isNumeric(expression)) {