Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-98180

Sending a null header or footer results in an NPE/Unable to remove headers/footers from the player list

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Minecraft 1.11.1
    • Minecraft 1.8.9, Minecraft 1.9 Pre-Release 4, Minecraft 1.9, Minecraft 1.10.2, Minecraft 1.11 Pre-Release 1, Minecraft 1.11.2
    • Unconfirmed

      Sending a null header or footer value when sending packet 0x47 will result in an NPE, due to the value not being checked before being turned into a formatted string:

          public void handlePlayerListHeaderFooter(S47PacketPlayerListHeaderFooter packetIn)
          {
              this.gameController.ingameGUI.getTabList().setHeader(packetIn.getHeader().getFormattedText().length() == 0 ? null : packetIn.getHeader());
              this.gameController.ingameGUI.getTabList().setFooter(packetIn.getFooter().getFormattedText().length() == 0 ? null : packetIn.getFooter());
          }
      

      The formatted text length is never zero - getFormattedText adds §r even if the provided text is empty - which means that there is no way to remove the header or footer, just make empty text/§r appear. Sending null, if it didn't call getFormattedText first, would work as intended.

            Unassigned Unassigned
            kashike [Mod] Riley Park
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: