Fixed NPE on playersList usage

This commit is contained in:
Oleg Agafonov 2020-08-25 23:41:41 +04:00
parent 6fa4c0b8f2
commit cf5b474c29
2 changed files with 2 additions and 2 deletions

View file

@ -1250,7 +1250,7 @@ public class Combat implements Serializable, Copyable<Combat> {
case RIGHT:
players = game.getState().getPlayerList(attackingPlayerId);
opponent = players.getPrevious(game);
while (attackingPlayer.isInGame()) {
while (opponent != null && attackingPlayer.isInGame()) {
if (attackingPlayer.hasOpponent(opponent.getId(), game)) {
attackablePlayers.add(opponent.getId());
break;