mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-10 03:52:45 +01:00
SPIGOT-438: Correct CraftScoreboard.getObjective NPEing instead of returning null for missing objectives
By: Thinkofdeath <thinkofdeath@spigotmc.org>
This commit is contained in:
parent
06a42b5a28
commit
9adc314b7e
1 changed files with 2 additions and 1 deletions
|
@ -37,7 +37,8 @@ public final class CraftScoreboard implements org.bukkit.scoreboard.Scoreboard {
|
|||
|
||||
public Objective getObjective(String name) throws IllegalArgumentException {
|
||||
Validate.notNull(name, "Name cannot be null");
|
||||
return new CraftObjective(this, board.getObjective(name));
|
||||
ScoreboardObjective nms = board.getObjective(name);
|
||||
return nms == null ? null : new CraftObjective(this, nms);
|
||||
}
|
||||
|
||||
public ImmutableSet<Objective> getObjectivesByCriteria(String criteria) throws IllegalArgumentException {
|
||||
|
|
Loading…
Reference in a new issue