[SPIGOT-7949] registering a new scoreboard objective with an empty display name throws a NPE Created: 05/Nov/24  Updated: 25/Dec/24  Resolved: 06/Nov/24

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: JustRed23 Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Environment:

Windows 11, Java 21


Attachments: File untitled-1.0-SNAPSHOT.jar    
Version: This server is running CraftBukkit version 3871-Spigot-d2eba2c-3f9263b (MC: 1.20.1) (Implementing API version 1.20.1-R0.1-SNAPSHOT)
Plugin: custom plugin, check attachment
Guidelines Read: Yes

 Description   

Registering a new objective on the main scoreboard with an empty string as display name, will generate a NullPointerException, where displayname is set to null through CraftChatMessage.fromStringOrNull returning null on string.isEmpty

 

erroring code (attachment):
Bukkit.getScoreboardManager().getMainScoreboard().registerNewObjective("test", Criteria.DUMMY, "");

 
log: https://mclo.gs/Crf4aoX


Generated at Sat Dec 13 20:47:03 UTC 2025 using Jira 10.3.13#10030013-sha1:56dd970ae30ebfeda3a697d25be1f6388b68a422.