Pixelmon Mod - Bug tracker

[1.12.2-8.1.2] NullPointer when getting Badge List fix completed

Ticket description:
In the PixelmonItemBadges class, the getBadgeList by enum types will result in a NullPointer as it cycles through the types and finds one that doesn't contain any badges, rather than skipping or adding none.

Code in question:
Code: Select all
    public static List<ItemBadge> getBadgeList(EnumType[] types) {
        List<ItemBadge> totalList = new ArrayList();
        EnumType[] var2 = types;
        int var3 = types.length;

        for(int var4 = 0; var4 < var3; ++var4) {
            EnumType type = var2[var4];
            List<ItemBadge> badgeList = getBadgeList(type);
            totalList.addAll(badgeList);
        }

        return totalList;
    }


The part that causes the crash is this part
Code: Select all            List<ItemBadge> badgeList = getBadgeList(type);
            totalList.addAll(badgeList);

Comments

#25261 Posted by Sophie847 » 19 May 2022 11:17

Hi there, and sorry for the super late response!

I have confirmed that the same two lines of code are present in our latest 8.4.2 release, and that a NPE would still occur if the addAll() method was passed an empty badgeList.

I have passed this information to internal to be resolved - thank you for your report!

#29204 Posted by Sophie847 » 15 Feb 2023 00:41

This should be resolved with the release of 9.1.3, thanks!

Ticket details

  • Ticket ID: 15596
  • Project: Pixelmon Mod
  • Status: Fix completed
  • Component: Error
  • Project version: 1.12.2-8.x.x
  • Priority: Normal
  • Severity: Normal
  • Forge/Sponge: 14.23.5.2838
  • What else would be useful to know?: (unknown)
  • Assigned to: Sophie847
  • Reported by: Tencao (Send PM)
  • Reporter's tickets: (List all tickets)
  • Reported on: 17 Mar 2021 09:03
  • Ticket last visited by: Sophie847 on 25 Mar 2023 07:17
JOIN THE TEAM