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(); } }