Check if FTeamWrapper exists for faction. Fixes #107

This commit is contained in:
drtshock 2014-11-05 11:06:15 -06:00
parent 289a4edc93
commit 11ae51a6ca

View File

@ -8,6 +8,7 @@ import org.bukkit.scoreboard.Scoreboard;
import org.bukkit.scoreboard.Team;
import java.util.*;
import java.util.logging.Level;
public class FTeamWrapper {
private static final Map<Faction, FTeamWrapper> wrappers = new HashMap<Faction, FTeamWrapper>();
@ -75,6 +76,10 @@ public class FTeamWrapper {
if (!FScoreboard.isSupportedByServer()) {
return;
}
if(!wrappers.containsKey(faction)) {
P.p.log(Level.WARNING, "Something went wrong when updating the prefix for %s", faction.getTag());
return;
}
wrappers.get(faction).updatePrefixes();
}