[SPIGOT-6666] Bundles items ArrayList not initialized if no items in NBT were given upon instance creation Created: 22/Jul/21 Updated: 23/Jul/21 Resolved: 23/Jul/21 |
|
Status: | Resolved |
Project: | Spigot |
Component/s: | None |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | Bug | Priority: | Minor |
Reporter: | TechnicallyCoded | Assignee: | Unassigned |
Resolution: | Fixed | Votes: | 0 |
Labels: | bug | ||
Environment: |
Windows 10 x64, |
Attachments: |
![]() |
Version: | This server is running CraftBukkit version 3188-Spigot-d03d7f1-c851639 (MC: 1.17.1) (Implementing API version 1.17.1-R0.1-SNAPSHOT) |
Plugin: | InventoryRollbackPlus |
Guidelines Read: | Yes |
Description |
Hello! I have the following issue that I believe is caused by a subtle bug in the spigot code. The Issue java.lang.NullPointerException: Cannot invoke "java.util.List.add(Object)" because "this.items" is null This seems to be caused by these lines I highlighted https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBundle.java#35-37,46-47.] Related stacktrace of the NPE https://pastebin.com/raw/c7Msfd0n
Expected behavior Ability to use a BukkitObjectInputStream to create a bundle object. (Noob's suggestion for fix: Initialize the this.items array upon instance creation. This could be completely wrong but I would be interested to hear what you think the problem could be ^^) Provided API Test Jar Run /kill with a non-empty bundle in your inventory. (/kill is used since this bug-producing code is from the InventoryRollbackPlus plugin, which triggers on death xD) Test Plugin source: https://github.com/TechnicallyCoded/SpigotApiBugReport-Bundles |