mirror of
https://github.com/PaperMC/Paper.git
synced 2025-02-04 14:41:29 +01:00
SPIGOT-438: Correct CraftScoreboard.getObjective NPEing instead of returning null for missing objectives
This commit is contained in:
parent
00eba538b0
commit
59dd2ddb9d
@ -37,7 +37,8 @@ public final class CraftScoreboard implements org.bukkit.scoreboard.Scoreboard {
|
|||||||
|
|
||||||
public Objective getObjective(String name) throws IllegalArgumentException {
|
public Objective getObjective(String name) throws IllegalArgumentException {
|
||||||
Validate.notNull(name, "Name cannot be null");
|
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 {
|
public ImmutableSet<Objective> getObjectivesByCriteria(String criteria) throws IllegalArgumentException {
|
||||||
|
Loading…
Reference in New Issue
Block a user