From 995655aa61d3d12e35354e04c4fe3f009c183968 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Thu, 9 Oct 2014 01:30:14 +0200 Subject: [PATCH] * Match - Fixed a bug during creation of game info that lets game worker die (second try). --- Mage/src/mage/game/match/MatchImpl.java | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/Mage/src/mage/game/match/MatchImpl.java b/Mage/src/mage/game/match/MatchImpl.java index abe81cd670..bc8245befa 100644 --- a/Mage/src/mage/game/match/MatchImpl.java +++ b/Mage/src/mage/game/match/MatchImpl.java @@ -286,14 +286,19 @@ public abstract class MatchImpl implements Match { if (currentPlayer == null) { currentPlayer = playerList.getCurrent(game); } - do { - if (counter > 0) { - playersInfo.append(" - "); - } - playersInfo.append(currentPlayer.getName()); - counter++; - currentPlayer = game.getPlayer(playerList.getNext()); - } while(!currentPlayer.getId().equals(game.getStartingPlayerId())); + if (currentPlayer != null) { + do { + if (counter > 0) { + playersInfo.append(" - "); + } + playersInfo.append(currentPlayer.getName()); + counter++; + currentPlayer = game.getPlayer(playerList.getNext()); + + } while(!currentPlayer.getId().equals(game.getStartingPlayerId())); + } else { + playersInfo.append("[got no players]"); + } String state; String result;