From 103bf593f379020613e3bc63c09f153932d92bc3 Mon Sep 17 00:00:00 2001 From: TfT_02 Date: Sun, 12 Jan 2014 10:30:04 +0100 Subject: [PATCH] Check null here as well Fixes #1664 --- .../gmail/nossr50/util/scoreboards/ScoreboardManager.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/util/scoreboards/ScoreboardManager.java b/src/main/java/com/gmail/nossr50/util/scoreboards/ScoreboardManager.java index f2668c24e..1b0d35773 100644 --- a/src/main/java/com/gmail/nossr50/util/scoreboards/ScoreboardManager.java +++ b/src/main/java/com/gmail/nossr50/util/scoreboards/ScoreboardManager.java @@ -170,7 +170,7 @@ public class ScoreboardManager { public static void cleanup(ScoreboardWrapper wrapper) { PLAYER_SCOREBOARDS.remove(wrapper.playerName); - if (wrapper.revertTask != null) { + if (wrapper != null && wrapper.revertTask != null) { wrapper.revertTask.cancel(); } } @@ -207,7 +207,7 @@ public class ScoreboardManager { // Selfboards 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(); } } @@ -217,7 +217,7 @@ public class ScoreboardManager { // Selfboards 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(); } }