Inventory#getLocation causes NPE when called on silent ender chest #143

Closed
opened 2020-07-02 06:02:29 -04:00 by Jikoo · 4 comments
Jikoo commented 2020-07-02 06:02:29 -04:00 (Migrated from github.com)

Specifically a 1.16 problem, may be Spigot's problem and not ours - last I recall silent ender chest is purely API-based.

Specifically a 1.16 problem, may be Spigot's problem and not ours - last I recall silent ender chest is purely API-based.
RoboMWM commented 2020-07-02 23:44:33 -04:00 (Migrated from github.com)

I think I've encountered this when attempting getLocation on an ender chest (or fake ender chest inventory?) as well a couple years ago. Let me see what I did about this...

I think I've encountered this when attempting getLocation on an ender chest (or fake ender chest inventory?) as well a couple years ago. Let me see what I did about this...
RoboMWM commented 2020-07-02 23:45:58 -04:00 (Migrated from github.com)

This isn't what I recall, but search results gave me this: https://github.com/MLG-Fortress/PrettySimpleShop/pull/7

This isn't what I recall, but search results gave me this: https://github.com/MLG-Fortress/PrettySimpleShop/pull/7
Jikoo commented 2020-07-03 00:01:41 -04:00 (Migrated from github.com)

Silent ender chest is API-only like I thought. Going to leave this open until I make time to double check it but it should be simple to reproduce.

InventoryView view = player.openInventory(bukkitPlayer.getEnderChest())
if (view != null) {
    view.getTopInventory().getLocation();
}
Silent ender chest [is API-only](https://github.com/lishid/OpenInv/blob/master/internal/v1_16_R1/src/main/java/com/lishid/openinv/internal/v1_16_R1/AnySilentContainer.java#L173-L178) like I thought. Going to leave this open until I make time to double check it but it should be simple to reproduce. ```Java InventoryView view = player.openInventory(bukkitPlayer.getEnderChest()) if (view != null) { view.getTopInventory().getLocation(); } ```
Jikoo commented 2020-09-27 07:25:57 -04:00 (Migrated from github.com)

Looks like this was fixed, kinda forgot about reporting it. Whoops.

Looks like this was [fixed](https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/commits/a339310c48548f0f82f923ff3f5fe2cdc7a8e8ba), kinda forgot about reporting it. Whoops.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: minster586/OpenInv#143
No description provided.