ensure that parameter permanent in WhenPutIntoGraveyeard trigger is not null before calling its methods
parent
291a92c252
commit
85a20ff543
|
@ -29,7 +29,11 @@ public class Archon_of_Justice {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void executeEvent(final MagicGame game,final MagicEvent event,final Object data[],final Object[] choiceResults) {
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event,
|
||||
final Object data[],
|
||||
final Object[] choiceResults) {
|
||||
final MagicPermanent permanent=event.getTarget(game,choiceResults,0);
|
||||
if (permanent!=null) {
|
||||
game.doAction(new MagicRemoveFromPlayAction(permanent,MagicLocationType.Exile));
|
||||
|
|
|
@ -14,16 +14,15 @@ public class Butcher_of_Malakir {
|
|||
@Override
|
||||
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final Object data) {
|
||||
final MagicGraveyardTriggerData triggerData=(MagicGraveyardTriggerData)data;
|
||||
if (MagicLocationType.Play==triggerData.fromLocation) {
|
||||
final MagicPlayer controller=permanent.getController();
|
||||
return new MagicEvent(
|
||||
final MagicPlayer controller = (permanent != null) ? permanent.getController() : null;
|
||||
return (MagicLocationType.Play==triggerData.fromLocation) ?
|
||||
new MagicEvent(
|
||||
permanent,
|
||||
controller,
|
||||
new Object[]{permanent,game.getOpponent(controller)},
|
||||
this,
|
||||
"Your opponent sacrifices a creature.");
|
||||
}
|
||||
return null;
|
||||
"Your opponent sacrifices a creature."):
|
||||
null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -45,17 +44,18 @@ public class Butcher_of_Malakir {
|
|||
public static final MagicTrigger T2 = new MagicTrigger(MagicTriggerType.WhenOtherPutIntoGraveyardFromPlay) {
|
||||
@Override
|
||||
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final Object data) {
|
||||
final MagicPermanent otherPermanent=(MagicPermanent)data;
|
||||
final MagicPlayer controller=permanent.getController();
|
||||
if (otherPermanent!=permanent&&otherPermanent.getController()==controller&&otherPermanent.isCreature()) {
|
||||
return new MagicEvent(
|
||||
final MagicPermanent otherPermanent = (MagicPermanent)data;
|
||||
final MagicPlayer controller = permanent.getController();
|
||||
return (otherPermanent != permanent &&
|
||||
otherPermanent.getController() == controller &&
|
||||
otherPermanent.isCreature()) ?
|
||||
new MagicEvent(
|
||||
permanent,
|
||||
controller,
|
||||
new Object[]{permanent,game.getOpponent(controller)},
|
||||
this,
|
||||
"Your opponent sacrifices a creature.");
|
||||
}
|
||||
return null;
|
||||
"Your opponent sacrifices a creature."):
|
||||
null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -16,7 +16,7 @@ public class Sprouting_Thrinax {
|
|||
@Override
|
||||
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final Object data) {
|
||||
final MagicGraveyardTriggerData triggerData=(MagicGraveyardTriggerData)data;
|
||||
final MagicPlayer player = permanent.getController();
|
||||
final MagicPlayer player = (permanent != null) ? permanent.getController() : null;
|
||||
return (MagicLocationType.Play==triggerData.fromLocation) ?
|
||||
new MagicEvent(
|
||||
permanent,
|
||||
|
|
|
@ -16,7 +16,7 @@ public class Tuktuk_the_Explorer {
|
|||
@Override
|
||||
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final Object data) {
|
||||
final MagicGraveyardTriggerData triggerData=(MagicGraveyardTriggerData)data;
|
||||
final MagicPlayer player = permanent.getController();
|
||||
final MagicPlayer player = (permanent != null) ? permanent.getController() : null;
|
||||
return (MagicLocationType.Play==triggerData.fromLocation) ?
|
||||
new MagicEvent(
|
||||
permanent,
|
||||
|
|
Loading…
Reference in New Issue