If scoreboard team is null, don't try to access it in the debug command

This commit is contained in:
libraryaddict 2021-07-20 22:13:00 +12:00
parent 0134788160
commit b9bd724502

View File

@ -62,6 +62,12 @@ public class LDScoreboard implements LDCommand {
continue; continue;
} }
DisguiseUtilities.DScoreTeam scoreboardName = ((PlayerDisguise) disguise).getScoreboardName();
if (scoreboardName.getTeamName() == null) {
continue;
}
ArrayList<Scoreboard> checked = new ArrayList<>(); ArrayList<Scoreboard> checked = new ArrayList<>();
for (Player player : Bukkit.getOnlinePlayers()) { for (Player player : Bukkit.getOnlinePlayers()) {
@ -72,7 +78,7 @@ public class LDScoreboard implements LDCommand {
} }
checked.add(board); checked.add(board);
DisguiseUtilities.DScoreTeam scoreboardName = ((PlayerDisguise) disguise).getScoreboardName();
Team team = board.getTeam(scoreboardName.getTeamName()); Team team = board.getTeam(scoreboardName.getTeamName());