InvUI icon indicating copy to clipboard operation
InvUI copied to clipboard

NullPointerException

Open Ckblck opened this issue 1 year ago • 0 comments

Hello,

I'm reporting an issue related to a sporadic null reference error:

[15:29:41 ERROR]: Could not pass event InventoryClickEvent to PyroShop v1.0.0
java.lang.NullPointerException: Cannot invoke "org.bukkit.inventory.ItemStack.getAmount()" because "itemStack" is null
        at xyz.xenondevs.invui.gui.AbstractGui.putIntoFirstInventory(AbstractGui.java:464) ~[PyroShop-1.0-SNAPSHOT-all.jar:?]
        at xyz.xenondevs.invui.gui.AbstractGui.handleItemShift(AbstractGui.java:447) ~[PyroShop-1.0-SNAPSHOT-all.jar:?]
        at xyz.xenondevs.invui.window.AbstractSingleWindow.handleItemShift(AbstractSingleWindow.java:89) ~[PyroShop-1.0-SNAPSHOT-all.jar:?]
        at xyz.xenondevs.invui.window.AbstractWindow.handleClickEvent(AbstractWindow.java:211) ~[PyroShop-1.0-SNAPSHOT-all.jar:?]
        at xyz.xenondevs.invui.window.WindowManager.handleInventoryClick(WindowManager.java:117) ~[PyroShop-1.0-SNAPSHOT-all.jar:?]
        at com.destroystokyo.paper.event.executor.MethodHandleEventExecutor.execute(MethodHandleEventExecutor.java:40) ~[?:git-UniverseSpigot-"ed7db9c"]
        at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:76) ~[?:git-UniverseSpigot-"ed7db9c"]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[?:git-UniverseSpigot-"ed7db9c"]
        at io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:87) ~[?:git-UniverseSpigot-"ed7db9c"]
        at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.callEvent(PaperPluginManagerImpl.java:126) ~[?:git-UniverseSpigot-"ed7db9c"]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:617) ~[?:git-UniverseSpigot-"ed7db9c"]
        at net.minecraft.server.network.ServerGamePacketListenerImpl.handleContainerClick(ServerGamePacketListenerImpl.java:3131) ~[?:?]
        at net.minecraft.network.protocol.game.ServerboundContainerClickPacket.handle(ServerboundContainerClickPacket.java:58) ~[?:?]
        at net.minecraft.network.protocol.game.ServerboundContainerClickPacket.handle(ServerboundContainerClickPacket.java:23) ~[?:?]
        at net.minecraft.network.protocol.PacketUtils.lambda$ensureRunningOnSameThread$0(PacketUtils.java:52) ~[?:?]
        at net.minecraft.server.TickTask.run(TickTask.java:18) ~[?:git-UniverseSpigot-"ed7db9c"]
        at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:152) ~[?:?]
        at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24) ~[?:?]
        at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1333) ~[?:git-UniverseSpigot-"ed7db9c"]
        at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:196) ~[?:git-UniverseSpigot-"ed7db9c"]
        at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:125) ~[?:?]
        at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1310) ~[?:git-UniverseSpigot-"ed7db9c"]
        at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1303) ~[?:git-UniverseSpigot-"ed7db9c"]
        at net.minecraft.util.thread.BlockableEventLoop.runAllTasks(BlockableEventLoop.java:113) ~[?:?]
        at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1417) ~[?:git-UniverseSpigot-"ed7db9c"]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1165) ~[?:git-UniverseSpigot-"ed7db9c"]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:320) ~[?:git-UniverseSpigot-"ed7db9c"]
        at java.lang.Thread.run(Thread.java:1575) ~[?:?]

The plugin currently uses InvUI 1.37, which I acknowledge is outdated. However, after reviewing the source of the null reference, it seems that this issue persists even in the latest version.

Server uses Geyser to also allow Bedrock players to play. The error occurs sporadically when players interact with the GUI. Unfortunately, I can't provide specific steps to reliably reproduce it, as it seems to happen randomly. Although rare, the error does arise periodically during user interaction.

I hope this helps in addressing the issue; InvUI is a fantastic library, and I truly appreciate the work behind it!

Ckblck avatar Jan 22 '25 18:01 Ckblck