mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 20:58:03 +00:00
- 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:
@@ -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;
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user