From 11ae51a6cadf55d2733a265535889bd2bc17a41f Mon Sep 17 00:00:00 2001 From: drtshock Date: Wed, 5 Nov 2014 11:06:15 -0600 Subject: [PATCH] Check if FTeamWrapper exists for faction. Fixes #107 --- .../com/massivecraft/factions/scoreboards/FTeamWrapper.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/com/massivecraft/factions/scoreboards/FTeamWrapper.java b/src/main/java/com/massivecraft/factions/scoreboards/FTeamWrapper.java index ed2ba314..40d9897a 100644 --- a/src/main/java/com/massivecraft/factions/scoreboards/FTeamWrapper.java +++ b/src/main/java/com/massivecraft/factions/scoreboards/FTeamWrapper.java @@ -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 wrappers = new HashMap(); @@ -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(); }