if artificial choice is empty, getSimulationResultChoice returns null
parent
7b2606e6c9
commit
2323cdbedc
|
@ -80,7 +80,11 @@ public abstract class MagicChoice {
|
||||||
final MagicPlayer player,
|
final MagicPlayer player,
|
||||||
final MagicSource source) {
|
final MagicSource source) {
|
||||||
final List<Object[]> choices = getArtificialChoiceResults(game, event, player, source);
|
final List<Object[]> choices = getArtificialChoiceResults(game, event, player, source);
|
||||||
return choices.get(MagicRandom.nextInt(choices.size()));
|
if (choices.size() == 0) {
|
||||||
|
return null;
|
||||||
|
} else {
|
||||||
|
return choices.get(MagicRandom.nextInt(choices.size()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Gets the choice results of the player. */
|
/** Gets the choice results of the player. */
|
||||||
|
|
Loading…
Reference in New Issue