Minor null pointer fix in InputControl.

This commit is contained in:
Doublestrike
2011-11-12 00:07:19 +00:00
parent bf9c24447f
commit 71196cd4cd

View File

@@ -223,8 +223,10 @@ public class InputControl extends MyObservable implements java.io.Serializable {
// ********************* // *********************
// Special phases handled above, everything else is handled simply by // Special phases handled above, everything else is handled simply by
// priority // priority
if (priority == null) {
if (priority.isHuman()) { return null;
}
else if (priority.isHuman()) {
final boolean skip = this.model.getGameState().getPhase().doSkipPhase(); final boolean skip = this.model.getGameState().getPhase().doSkipPhase();
this.model.getGameState().getPhase().setSkipPhase(false); this.model.getGameState().getPhase().setSkipPhase(false);
if ((this.model.getGameState().getStack().size() == 0) if ((this.model.getGameState().getStack().size() == 0)
@@ -234,9 +236,11 @@ public class InputControl extends MyObservable implements java.io.Serializable {
} else { } else {
return new InputPassPriority(); return new InputPassPriority();
} }
} else if (playerTurn.isComputer()) { }
else if (playerTurn.isComputer()) {
return this.aiInput; return this.aiInput;
} else { }
else {
this.aiInput.getComputer().stackNotEmpty(); this.aiInput.getComputer().stackNotEmpty();
return null; return null;
} }