Fix NPE with Scoreboards when updating

This commit is contained in:
nossr50
2021-03-25 14:13:16 -07:00
parent eea922c31f
commit fc3e580550
2 changed files with 9 additions and 6 deletions

View File

@ -428,14 +428,16 @@ public class ScoreboardWrapper {
* Load new values into the sidebar.
*/
private void updateSidebar() {
try {
updateTask.cancel();
}
catch (Exception e) {
e.printStackTrace();
if(updateTask != null) {
try {
updateTask.cancel();
} catch (Exception e) {
e.printStackTrace();
}
updateTask = null;
}
updateTask = null;
if (sidebarType == SidebarType.NONE) {
return;