GameChatManager: Check if the game exists

This commit is contained in:
samczsun 2016-10-10 09:30:17 -04:00
parent 873e93747e
commit 07c93606f8

View File

@ -274,7 +274,7 @@ public class GameChatManager implements Listener
private JsonMessage buildJSON(Player player, String prefix, String rankStr, Rank rank, String name, LinkedList<ChatStatData> hoverText, String message) private JsonMessage buildJSON(Player player, String prefix, String rankStr, Rank rank, String name, LinkedList<ChatStatData> hoverText, String message)
{ {
if(_manager.GetGame().GetState() != GameState.Prepare && _manager.GetGame().GetState() != GameState.Live && _manager.GetGame().GetState() != GameState.End) if(_manager.GetGame() == null || (_manager.GetGame().GetState() != GameState.Prepare && _manager.GetGame().GetState() != GameState.Live && _manager.GetGame().GetState() != GameState.End))
{ {
if(rank == Rank.ALL) if(rank == Rank.ALL)
{ {
@ -300,7 +300,7 @@ public class GameChatManager implements Listener
{ {
if (!_manager.GetGame().GetStats().containsKey(player)) if (!_manager.GetGame().GetStats().containsKey(player))
{ {
temp.add(new AbstractMap.SimpleEntry<String, String>(C.cGray + "Retrieving stats...", "")); temp.add(new AbstractMap.SimpleEntry<String, String>(C.cGray + "No in-game stats available", ""));
break; break;
} }