Fixed some NPEs

This commit is contained in:
CoderTim 2014-09-03 16:53:29 -04:00
parent d5766d62ae
commit 39b46bc8f5
3 changed files with 12 additions and 6 deletions

View File

@ -38,6 +38,8 @@ public class ParalympicsStatTracker extends StatTracker<Game>
{ {
List<Player> winners = getGame().getWinners(); List<Player> winners = getGame().getWinners();
if (winners != null)
{
for (Player winner : winners) for (Player winner : winners)
{ {
if (!_hasLeaped.contains(winner.getUniqueId())) if (!_hasLeaped.contains(winner.getUniqueId()))
@ -46,4 +48,5 @@ public class ParalympicsStatTracker extends StatTracker<Game>
} }
} }
} }
}

View File

@ -32,7 +32,7 @@ public class SharpShooterStatTracker extends StatTracker<Game>
if (event.getEntity().getShooter() instanceof Player && event.getEntity() instanceof Arrow) if (event.getEntity().getShooter() instanceof Player && event.getEntity() instanceof Arrow)
{ {
Player player = (Player) event.getEntity(); Player player = (Player) event.getEntity().getShooter();
Integer count = _arrowsShot.get(player.getUniqueId()); Integer count = _arrowsShot.get(player.getUniqueId());
count = (count == null ? 0 : count) + 1; count = (count == null ? 0 : count) + 1;

View File

@ -45,6 +45,8 @@ public class TheComebackStatTracker extends StatTracker<TurfForts>
if (event.GetState() == Game.GameState.End) if (event.GetState() == Game.GameState.End)
{ {
if (_hasWentFiveOrBelow.contains(getGame().WinnerTeam)) if (_hasWentFiveOrBelow.contains(getGame().WinnerTeam))
{
if (getGame().getWinners() != null)
{ {
for (Player player : getGame().getWinners()) for (Player player : getGame().getWinners())
addStat(player, "TheComeback", 1, true, false); addStat(player, "TheComeback", 1, true, false);
@ -52,3 +54,4 @@ public class TheComebackStatTracker extends StatTracker<TurfForts>
} }
} }
} }
}