Fix an NPE with quest tracking when using /game stop

This commit is contained in:
Sam 2017-11-08 00:18:36 +00:00 committed by Alexander Meech
parent 098afc2bf4
commit 1c5bbda8cd

View File

@ -1,5 +1,7 @@
package nautilus.game.arcade.quest; package nautilus.game.arcade.quest;
import java.util.List;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
@ -30,7 +32,14 @@ public class WinQuestTracker extends QuestTracker<Game>
if (event.GetState() != GameState.End) if (event.GetState() != GameState.End)
return; return;
for (Player player : getGame().getWinners()) List<Player> winners = getGame().getWinners();
if (winners == null)
{
return;
}
for (Player player : winners)
{ {
incrementQuests(player, 1, ((Arcade) UtilServer.getPlugin()).getServerConfig().getServerGroup().getPrefix(), getGame().GetKit(player).GetName() + "Kit"); incrementQuests(player, 1, ((Arcade) UtilServer.getPlugin()).getServerConfig().getServerGroup().getPrefix(), getGame().GetKit(player).GetName() + "Kit");
} }