- Fixed NPEs in the new prompt input code (we should not assume that SA vars will be filled in at all times).

This commit is contained in:
Agetian
2017-01-21 19:20:46 +00:00
parent 001b6aea84
commit 828359c0bc
3 changed files with 12 additions and 10 deletions

View File

@@ -81,7 +81,7 @@ public class InputConfirm extends InputSyncronizedBase {
defaultYes = defaultYes0; defaultYes = defaultYes0;
result = defaultYes0; result = defaultYes0;
this.sa = sa0; this.sa = sa0;
this.card = sa.getView().getHostCard(); this.card = sa != null ? sa.getView().getHostCard() : null;
} }
public InputConfirm(final PlayerControllerHuman controller, String message0, CardView card0) { public InputConfirm(final PlayerControllerHuman controller, String message0, CardView card0) {

View File

@@ -36,8 +36,10 @@ public abstract class InputSelectManyBase<T extends GameEntity> extends InputSyn
protected InputSelectManyBase(final PlayerControllerHuman controller, final int min, final int max, final SpellAbility sa0) { protected InputSelectManyBase(final PlayerControllerHuman controller, final int min, final int max, final SpellAbility sa0) {
this(controller,min,max); this(controller,min,max);
this.sa = sa0; this.sa = sa0;
if (sa0 != null) {
this.card = sa0.getView().getHostCard(); this.card = sa0.getView().getHostCard();
} }
}
protected InputSelectManyBase(final PlayerControllerHuman controller, final int min, final int max, final CardView card0) { protected InputSelectManyBase(final PlayerControllerHuman controller, final int min, final int max, final CardView card0) {
this(controller,min,max); this(controller,min,max);