EssentialsX

EssentialsX

2M Downloads

NPE when running /clearinventory from console

Rbot48 opened this issue ยท 2 comments

commented

EssentialsX version (run /essentials):
Essentials 2.0.1-b565

Server software (run /version):
CraftBukkit version git-Spigot-de459a2-51263e9 (MC: 1.10.2)

EssentialsX config (plugins/Essentials/config.yml):
Default config: https://gist.github.com/Rbot48/58f578637ef2dfb9fae95896e7405c40

Details:

The following error is displayed when running the command /ci from console:

[19:21:00 INFO]: CONSOLE issued server command: /ci
[19:21:00 INFO]: Error: null
[19:21:00 INFO]: Error calling the command /ci
java.lang.NullPointerException
        at com.earth2me.essentials.commands.Commandclearinventory.parseCommand(C                                                                                         ommandclearinventory.java:47) ~[EssentialsX-2.0.1.jar:?]
        at com.earth2me.essentials.commands.Commandclearinventory.run(Commandcle                                                                                         arinventory.java:39) ~[EssentialsX-2.0.1.jar:?]
        at com.earth2me.essentials.commands.EssentialsCommand.run(EssentialsComm                                                                                         and.java:167) ~[EssentialsX-2.0.1.jar:?]
        at com.earth2me.essentials.Essentials.onCommandEssentials(Essentials.jav                                                                                         a:511) [EssentialsX-2.0.1.jar:?]
        at com.earth2me.essentials.Essentials.onCommand(Essentials.java:426) [Es                                                                                         sentialsX-2.0.1.jar:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) [Spig                                                                                         ot%201.10.jar:git-Spigot-de459a2-51263e9]
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:14                                                                                         1) [Spigot%201.10.jar:git-Spigot-de459a2-51263e9]
        at org.bukkit.craftbukkit.v1_10_R1.CraftServer.dispatchCommand(CraftServ                                                                                         er.java:647) [Spigot%201.10.jar:git-Spigot-de459a2-51263e9]
        at org.bukkit.craftbukkit.v1_10_R1.CraftServer.dispatchServerCommand(Cra                                                                                         ftServer.java:633) [Spigot%201.10.jar:git-Spigot-de459a2-51263e9]
        at net.minecraft.server.v1_10_R1.DedicatedServer.aL(DedicatedServer.java                                                                                         :438) [Spigot%201.10.jar:git-Spigot-de459a2-51263e9]
        at net.minecraft.server.v1_10_R1.DedicatedServer.D(DedicatedServer.java:                                                                                         401) [Spigot%201.10.jar:git-Spigot-de459a2-51263e9]
        at net.minecraft.server.v1_10_R1.MinecraftServer.C(MinecraftServer.java:                                                                                         668) [Spigot%201.10.jar:git-Spigot-de459a2-51263e9]
        at net.minecraft.server.v1_10_R1.MinecraftServer.run(MinecraftServer.jav                                                                                         a:567) [Spigot%201.10.jar:git-Spigot-de459a2-51263e9]
        at java.lang.Thread.run(Unknown Source) [?:1.8.0_152]
[19:21:00 WARN]: java.lang.NullPointerException
[19:21:00 WARN]:        at com.earth2me.essentials.commands.Commandclearinventor                                                                                         y.parseCommand(Commandclearinventory.java:47)
[19:21:00 WARN]:        at com.earth2me.essentials.commands.Commandclearinventor                                                                                         y.run(Commandclearinventory.java:39)
[19:21:00 WARN]:        at com.earth2me.essentials.commands.EssentialsCommand.ru                                                                                         n(EssentialsCommand.java:167)
[19:21:00 WARN]:        at com.earth2me.essentials.Essentials.onCommandEssential                                                                                         s(Essentials.java:511)
[19:21:00 WARN]:        at com.earth2me.essentials.Essentials.onCommand(Essentia                                                                                         ls.java:426)
[19:21:00 WARN]:        at org.bukkit.command.PluginCommand.execute(PluginComman                                                                                         d.java:44)
[19:21:00 WARN]:        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCo                                                                                         mmandMap.java:141)
[19:21:00 WARN]:        at org.bukkit.craftbukkit.v1_10_R1.CraftServer.dispatchC                                                                                         ommand(CraftServer.java:647)
[19:21:00 WARN]:        at org.bukkit.craftbukkit.v1_10_R1.CraftServer.dispatchS                                                                                         erverCommand(CraftServer.java:633)
[19:21:00 WARN]:        at net.minecraft.server.v1_10_R1.DedicatedServer.aL(Dedi                                                                                         catedServer.java:438)
[19:21:00 WARN]:        at net.minecraft.server.v1_10_R1.DedicatedServer.D(Dedic                                                                                         atedServer.java:401)
[19:21:00 WARN]:        at net.minecraft.server.v1_10_R1.MinecraftServer.C(Minec                                                                                         raftServer.java:668)
[19:21:00 WARN]:        at net.minecraft.server.v1_10_R1.MinecraftServer.run(Min                                                                                         ecraftServer.java:567)
[19:21:00 WARN]:        at java.lang.Thread.run(Unknown Source)

From what I can see, it seems like the confirmation system is causing this.

commented

@Rbot48 Appears to be a bug, Good catch. Issue is that the command assumes that a user will be using it.

User senderUser = ess.getUser(sender.getPlayer());
// Clear previous command execution before potential errors to reset confirmation.
String previousClearCommand = senderUser.getConfirmingClearCommand(); //line 47, nullpointer if getUser() returns null
commented

PR for a fix has been opened.
#1756