Check null here as well

Fixes #1664
This commit is contained in:
TfT_02 2014-01-12 10:30:04 +01:00
parent 0332c0f5e0
commit 103bf593f3

View File

@ -170,7 +170,7 @@ public class ScoreboardManager {
public static void cleanup(ScoreboardWrapper wrapper) { public static void cleanup(ScoreboardWrapper wrapper) {
PLAYER_SCOREBOARDS.remove(wrapper.playerName); PLAYER_SCOREBOARDS.remove(wrapper.playerName);
if (wrapper.revertTask != null) { if (wrapper != null && wrapper.revertTask != null) {
wrapper.revertTask.cancel(); wrapper.revertTask.cancel();
} }
} }
@ -207,7 +207,7 @@ public class ScoreboardManager {
// Selfboards // Selfboards
ScoreboardWrapper wrapper = PLAYER_SCOREBOARDS.get(player.getName()); ScoreboardWrapper wrapper = PLAYER_SCOREBOARDS.get(player.getName());
if (wrapper.isSkillScoreboard() && wrapper.targetSkill == skill && wrapper.isBoardShown()) { if (wrapper != null && wrapper.isSkillScoreboard() && wrapper.targetSkill == skill && wrapper.isBoardShown()) {
wrapper.doSidebarUpdateSoon(); wrapper.doSidebarUpdateSoon();
} }
} }
@ -217,7 +217,7 @@ public class ScoreboardManager {
// Selfboards // Selfboards
ScoreboardWrapper wrapper = PLAYER_SCOREBOARDS.get(player.getName()); ScoreboardWrapper wrapper = PLAYER_SCOREBOARDS.get(player.getName());
if ((wrapper.isCooldownScoreboard() || wrapper.isSkillScoreboard() && wrapper.targetSkill == skill) && wrapper.isBoardShown()) { if (wrapper != null && (wrapper.isCooldownScoreboard() || wrapper.isSkillScoreboard() && wrapper.targetSkill == skill) && wrapper.isBoardShown()) {
wrapper.doSidebarUpdateSoon(); wrapper.doSidebarUpdateSoon();
} }
} }