Browse Source

ArrayIndexOutOfBoundsException masking.

_DS_ 15 năm trước cách đây
mục cha
commit
04397a71aa

+ 16 - 3
L2_GameServer/java/net/sf/l2j/gameserver/model/olympiad/Olympiad.java

@@ -1000,14 +1000,27 @@ public class Olympiad
 	
 	public static void removeSpectator(int id, L2PcInstance spectator)
 	{
-		OlympiadManager.STADIUMS[id].removeSpectator(spectator);
+		try
+		{
+			OlympiadManager.STADIUMS[id].removeSpectator(spectator);
+		}
+		catch (ArrayIndexOutOfBoundsException e)
+		{
+		}
 	}
 	
 	public L2FastList<L2PcInstance> getSpectators(int id)
 	{
-		if (OlympiadManager.getInstance().getOlympiadGame(id) == null)
+		try
+		{
+			if (OlympiadManager.getInstance().getOlympiadGame(id) == null)
+				return null;
+			return OlympiadManager.STADIUMS[id].getSpectators();
+		}
+		catch (ArrayIndexOutOfBoundsException e)
+		{
 			return null;
-		return OlympiadManager.STADIUMS[id].getSpectators();
+		}
 	}
 	
 	public Map<Integer, OlympiadGame> getOlympiadGames()