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

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Fixed
    • Affects Version/s: 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
    • Fix Version/s: Minecraft 1.11.1
    • Confirmation Status:
      Unconfirmed

      Description

      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.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            kashike [Mod] kashike (Riley Park)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: