Thatsmusic99 / HeadsPlus-Archived

A Minecraft heads plugin with many different features that make it unique in multiple ways.
https://www.spigotmc.org/resources/headsplus-1-8-x-1-12-x.40265/
MIT License
11 stars 6 forks source link

NPE relating to advent calendar #38

Closed steve4744 closed 5 years ago

steve4744 commented 5 years ago

Short summary of issue

Running command /heads causes NPE

Server version

1.14.2

HeadsPlus version

6.3.2

Detailed description (how you found it, what you were doing at the time)

Running /heads command

Expected behaviour

No NPE

Actual behaviour

NPE

Steps to reproduce

Run /heads command

Any last notes?

[18:01:35] [Server thread/INFO]: steve4744 issued server command: /heads
[18:01:35] [Server thread/WARN]: [HeadsPlus] Unexpected Error processing section advent-calendar
java.lang.NullPointerException: null
        at io.github.thatsmusic99.headsplus.config.headsx.HeadsPlusConfigHeadsX.getSkull(HeadsPlusConfigHeadsX.java:165) ~[?:?]
        at io.github.thatsmusic99.headsplus.util.InventoryManager.getListMainMenu(InventoryManager.java:218) ~[?:?]
        at io.github.thatsmusic99.headsplus.util.InventoryManager.getPageInventory(InventoryManager.java:181) ~[?:?]
        at io.github.thatsmusic99.headsplus.util.InventoryManager.showScreen(InventoryManager.java:102) ~[?:?]
        at io.github.thatsmusic99.headsplus.commands.Heads.onCommand(Heads.java:38) ~[?:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[spigot-1.14.2.jar:git-Spigot-baafee9-043d31d]
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:149) ~[spigot-1.14.2.jar:git-Spigot-baafee9-043d31d]
        at org.bukkit.craftbukkit.v1_14_R1.CraftServer.dispatchCommand(CraftServer.java:707) ~[spigot-1.14.2.jar:git-Spigot-baafee9-043d31d]
        at net.minecraft.server.v1_14_R1.PlayerConnection.handleCommand(PlayerConnection.java:1670) ~[spigot-1.14.2.jar:git-Spigot-baafee9-043d31d]
        at net.minecraft.server.v1_14_R1.PlayerConnection.a(PlayerConnection.java:1510) ~[spigot-1.14.2.jar:git-Spigot-baafee9-043d31d]
        at net.minecraft.server.v1_14_R1.PacketPlayInChat.a(PacketPlayInChat.java:47) ~[spigot-1.14.2.jar:git-Spigot-baafee9-043d31d]
        at net.minecraft.server.v1_14_R1.PacketPlayInChat.a(PacketPlayInChat.java:1) ~[spigot-1.14.2.jar:git-Spigot-baafee9-043d31d]
        at net.minecraft.server.v1_14_R1.PlayerConnectionUtils.lambda$0(PlayerConnectionUtils.java:13) ~[spigot-1.14.2.jar:git-Spigot-baafee9-043d31d]
        at net.minecraft.server.v1_14_R1.TickTask.run(SourceFile:18) [spigot-1.14.2.jar:git-Spigot-baafee9-043d31d]
        at net.minecraft.server.v1_14_R1.IAsyncTaskHandler.executeTask(SourceFile:135) [spigot-1.14.2.jar:git-Spigot-baafee9-043d31d]
        at net.minecraft.server.v1_14_R1.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23) [spigot-1.14.2.jar:git-Spigot-baafee9-043d31d]
        at net.minecraft.server.v1_14_R1.IAsyncTaskHandler.executeNext(SourceFile:114) [spigot-1.14.2.jar:git-Spigot-baafee9-043d31d]
        at net.minecraft.server.v1_14_R1.MinecraftServer.aW(MinecraftServer.java:895) [spigot-1.14.2.jar:git-Spigot-baafee9-043d31d]
        at net.minecraft.server.v1_14_R1.MinecraftServer.executeNext(MinecraftServer.java:888) [spigot-1.14.2.jar:git-Spigot-baafee9-043d31d]
        at net.minecraft.server.v1_14_R1.IAsyncTaskHandler.awaitTasks(SourceFile:123) [spigot-1.14.2.jar:git-Spigot-baafee9-043d31d]
        at net.minecraft.server.v1_14_R1.MinecraftServer.sleepForTick(MinecraftServer.java:872) [spigot-1.14.2.jar:git-Spigot-baafee9-043d31d]
        at net.minecraft.server.v1_14_R1.MinecraftServer.run(MinecraftServer.java:805) [spigot-1.14.2.jar:git-Spigot-baafee9-043d31d]
        at java.lang.Thread.run(Unknown Source) [?:1.8.0_212]
Thatsmusic99 commented 5 years ago

By the looks of it, it's due to the fact that the plugin couldn't find one of the heads for the given section - will make a more friendly workaround though so it doesn't interfere with loading /heads.

Thatsmusic99 commented 5 years ago

Made more friendly here: https://github.com/Thatsmusic99/HeadsPlus/releases/tag/v6.3.3-SNAPSHOT-1

steve4744 commented 5 years ago

Thanks, that's fixed the npe. I get the message below logged to the console every time I click on 'Main Menu' within /heads, but that's fine its not a problem. Issue can be closed. [00:52:43] [Server thread/WARN]: [HeadsPlus] Head texture for section advent-calendar not found.