Fixed npe in scoreboard manager

This commit is contained in:
Fabrizio La Rosa 2020-08-07 18:17:27 +02:00
parent 28f3e9aa13
commit 92e2769c55

View File

@ -26,19 +26,21 @@ class Holder {
PlaceholderManager placeholderManager = plugin.getPlaceholderManager();
ScoreboardManager scoreboardManager = plugin.getScoreboardManager();
if (!scoreboardManager.isPlayerDisabled(player)) {
board.setTitle(driver.getTitle().getLine());
int count = 0;
for(Row row : driver.getRows()) {
String line = placeholderManager.parsePlaceholders(player, row.getLine());
board.setLine(count, line);
count++;
if(scoreboardManager != null) {
if (!scoreboardManager.isPlayerDisabled(player)) {
board.setTitle(driver.getTitle().getLine());
int count = 0;
for(Row row : driver.getRows()) {
String line = placeholderManager.parsePlaceholders(player, row.getLine());
board.setLine(count, line);
count++;
}
this.player.setScoreboard(board.getBoard());
} else {
this.player.setScoreboard(scoreboardManager.getEmptyScoreboard());
}
this.player.setScoreboard(board.getBoard());
} else {
this.player.setScoreboard(scoreboardManager.getEmptyScoreboard());
}
}