Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-7949

registering a new scoreboard objective with an empty display name throws a NPE

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • None
    • None
    • Windows 11, Java 21

    • This server is running CraftBukkit version 3871-Spigot-d2eba2c-3f9263b (MC: 1.20.1) (Implementing API version 1.20.1-R0.1-SNAPSHOT)
    • custom plugin, check attachment
    • Yes

      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

            Unassigned Unassigned
            JustRed23 JustRed23
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: