浏览代码

Fixes #3062 (2 NPEs)

DrHouse 16 年之前
父节点
当前提交
54b1f7ac2b
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      L2_GameServer/java/net/sf/l2j/gameserver/Olympiad.java

+ 6 - 0
L2_GameServer/java/net/sf/l2j/gameserver/Olympiad.java

@@ -740,6 +740,9 @@ public class Olympiad
 
 
         for (L2OlympiadGame g : _manager.getOlympiadGames().values())
         for (L2OlympiadGame g : _manager.getOlympiadGames().values())
         {
         {
+        	if (g == null)
+        		continue;
+        	
         	for(L2PcInstance player : g.getPlayers())
         	for(L2PcInstance player : g.getPlayers())
         	{
         	{
         		if(player.getObjectId() == noble.getObjectId())
         		if(player.getObjectId() == noble.getObjectId())
@@ -865,6 +868,9 @@ public class Olympiad
         
         
         for(L2OlympiadGame game: _manager.getOlympiadGames().values())
         for(L2OlympiadGame game: _manager.getOlympiadGames().values())
         {
         {
+        	if (game == null)
+        		continue;
+        	
         	if(game._playerOne.getObjectId() == noble.getObjectId() || game._playerTwo.getObjectId() == noble.getObjectId())
         	if(game._playerOne.getObjectId() == noble.getObjectId() || game._playerTwo.getObjectId() == noble.getObjectId())
         	{
         	{
         		noble.sendMessage("Cant Unregister whilst you are already selected for a game");
         		noble.sendMessage("Cant Unregister whilst you are already selected for a game");