[SPIGOT-1489] CraftInventoryPlayer#getHolder() throws NPE instead of returning Null. Created: 13/Feb/16  Updated: 21/Feb/16  Resolved: 21/Feb/16

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Cayorion Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: CraftInventoryPlayer, NMS, NPE, PlayerInventory
Environment:

OS Name: Microsoft Windows 10 Pro
OS Version: 10.0.10240
OS Arch: amd64
Java VM: Java HotSpot(TM) 64-Bit Server VM
Java Version: 1.8.0_66
Java Vendor: Oracle Corporation
Runtime Processors: 8
Runtime Memory: 5.9351GB
CPU Name: Intel(R) Core(TM) i7-4790T CPU @ 2.70GHz
CPU Speed: 2.7GHz
CPU Physical: 4
CPU Logical: 8
RAM Size: 31.9423GB
RAM Speed: 1.6GHz
Disc Size: 952.9141GB


Plugin: Spigot + MassiveCore

 Description   

MassiveCore makes use of reflection to clone player inventories. This is very useful since custom player inventories as provided by the Bukkit API does not provide armor slot support.

A player brought to my attention that this some times will cause an NPE:
https://www.spigotmc.org/threads/massivebooks.35756/page-2#post-1283791
http://puu.sh/mTql9/01346092f4.txt

It happens at the following line in CraftBukkit
https://gyazo.com/490118d4bbdaa03a4bc09a7f352437ff

This is the current section in NMS:
https://gyazo.com/9a663a255730365838fdf8db33cc4e71

I kindly ask that you add the following NPE evasion line:
https://gyazo.com/447dfda9d63d3d2bbb426d1215deacd4



 Comments   
Comment by md_5 [ 21/Feb/16 ]

Not an issue possible in Vanilla or with API usage.

Generated at Fri Apr 11 16:22:20 UTC 2025 using Jira 10.3.3#10030003-sha1:d220e3fefc8dfc6d47f522d3b9a20c1455e12b7b.