Prevent null winner on veteran tracker
This commit is contained in:
parent
7c92971346
commit
41ef1a757c
@ -1,5 +1,6 @@
|
||||
package nautilus.game.arcade.game.games.mineware.tracker;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
|
||||
@ -20,8 +21,13 @@ public class VeteranTracker extends StatTracker<Game>
|
||||
{
|
||||
if (event.GetState() == GameState.End)
|
||||
{
|
||||
System.out.println("Veteran: " + getGame().getWinners().get(0).getName());
|
||||
addStat(getGame().getWinners().get(0), "Veteran", 1, true, false);
|
||||
Player winner = getGame().getWinners().get(0);
|
||||
|
||||
if (winner != null)
|
||||
{
|
||||
System.out.println("Veteran: " + winner.getName());
|
||||
addStat(winner, "Veteran", 1, true, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user