mirror of
https://github.com/magefree/mage.git
synced 2025-12-21 11:02:00 -08:00
game: fixed some NPE errors
This commit is contained in:
parent
a078b67434
commit
b80f440e15
2 changed files with 4 additions and 1 deletions
|
|
@ -19,6 +19,9 @@ public class AttachedToMatchesFilterCondition implements Condition {
|
||||||
|
|
||||||
public AttachedToMatchesFilterCondition(FilterPermanent filter) {
|
public AttachedToMatchesFilterCondition(FilterPermanent filter) {
|
||||||
this.filter = filter;
|
this.filter = filter;
|
||||||
|
if (filter == null) {
|
||||||
|
throw new IllegalStateException("Wrong code usage. Filter must be non-nullable.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ public class ChooseModeEffect extends OneShotEffect {
|
||||||
if (sourcePermanent == null) {
|
if (sourcePermanent == null) {
|
||||||
sourcePermanent = game.getPermanentEntering(source.getSourceId());
|
sourcePermanent = game.getPermanentEntering(source.getSourceId());
|
||||||
}
|
}
|
||||||
if (controller != null) {
|
if (controller != null && sourcePermanent != null) {
|
||||||
Choice choice = new ChoiceImpl(true);
|
Choice choice = new ChoiceImpl(true);
|
||||||
choice.setMessage(choiceMessage);
|
choice.setMessage(choiceMessage);
|
||||||
choice.getChoices().addAll(modes);
|
choice.getChoices().addAll(modes);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue