From cbeab91889b75578abe9c38adbba55f7001a3be9 Mon Sep 17 00:00:00 2001 From: magenoxx Date: Thu, 19 May 2011 23:49:15 +0400 Subject: [PATCH] Minor fixes in table manager and matchImpl. --- Mage.Server/src/main/java/mage/server/TableManager.java | 3 ++- Mage/src/mage/game/match/MatchImpl.java | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Mage.Server/src/main/java/mage/server/TableManager.java b/Mage.Server/src/main/java/mage/server/TableManager.java index 8931359197..2290a8d2e6 100644 --- a/Mage.Server/src/main/java/mage/server/TableManager.java +++ b/Mage.Server/src/main/java/mage/server/TableManager.java @@ -210,7 +210,8 @@ public class TableManager { controllers.remove(tableId); tables.remove(tableId); GamesRoomManager.getInstance().removeTable(tableId); - table.getMatch().getGame().end(); + if (table.getMatch().getGame() != null) + table.getMatch().getGame().end(); } } diff --git a/Mage/src/mage/game/match/MatchImpl.java b/Mage/src/mage/game/match/MatchImpl.java index 755b417234..f0f63e5c77 100644 --- a/Mage/src/mage/game/match/MatchImpl.java +++ b/Mage/src/mage/game/match/MatchImpl.java @@ -103,6 +103,7 @@ public abstract class MatchImpl implements Match { @Override public Game getGame() { + if (games.size() == 0) return null; return games.get(games.size() -1); }