mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 02:30:08 -08:00
fix client NPE if Radiation trigger in trigger order panel
The frameStyle was unexpectedly null when displaying the trigger in the view to choose trigger panels. It was good on the stack so I missed that in initial implementation. Bug showed up once there was another trigger on Beginning of Main Phase, for instance Coalition Relic. The lack of frameStyle lead to a rendering NPE.
This commit is contained in:
parent
a35078440a
commit
c0c05579ba
3 changed files with 13 additions and 1 deletions
|
|
@ -96,11 +96,21 @@ public class CardsView extends LinkedHashMap<UUID, CardView> {
|
|||
case STACK:
|
||||
case HAND: // Miracle
|
||||
case LIBRARY:
|
||||
sourceObject = game.getObject(ability.getSourceId());
|
||||
if (sourceObject instanceof Card) {
|
||||
isCard = true;
|
||||
}
|
||||
break;
|
||||
case OUTSIDE:
|
||||
sourceObject = game.getObject(ability.getSourceId());
|
||||
if (sourceObject instanceof Card) {
|
||||
isCard = true;
|
||||
}
|
||||
if (sourceObject instanceof Emblem) {
|
||||
// Emblems are not normally OUTSIDE, except the special Radiation Emblem from rad counters.
|
||||
abilityView = new AbilityView(ability, sourceObject.getName(), new CardView(new EmblemView((Emblem) sourceObject)));
|
||||
abilityView.setName(sourceObject.getName());
|
||||
}
|
||||
break;
|
||||
case COMMAND:
|
||||
sourceObject = game.getObject(ability.getSourceId());
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ public abstract class Emblem extends CommandObjectImpl {
|
|||
protected MageObject sourceObject; // can be null
|
||||
private boolean copy;
|
||||
private MageObject copyFrom; // copied card INFO (used to call original adjusters)
|
||||
private FrameStyle frameStyle;
|
||||
protected FrameStyle frameStyle;
|
||||
private Abilities<Ability> abilites = new AbilitiesImpl<>();
|
||||
|
||||
public Emblem(String name) {
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import mage.abilities.condition.Condition;
|
|||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.Cards;
|
||||
import mage.cards.FrameStyle;
|
||||
import mage.cards.repository.TokenInfo;
|
||||
import mage.cards.repository.TokenRepository;
|
||||
import mage.constants.Outcome;
|
||||
|
|
@ -27,6 +28,7 @@ public class RadiationEmblem extends Emblem {
|
|||
|
||||
public RadiationEmblem() {
|
||||
super("Radiation");
|
||||
this.frameStyle = FrameStyle.M15_NORMAL;
|
||||
|
||||
this.getAbilities().add(new ConditionalInterveningIfTriggeredAbility(
|
||||
new BeginningOfPreCombatMainTriggeredAbility(Zone.ALL, new RadiationEffect(), TargetController.YOU, false, false),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue