apavarino / Deadchest

Minecraft Plugin - Keep your inventory in a chest when you die !
https://dev.bukkit.org/projects/dead-chest
GNU General Public License v3.0
18 stars 17 forks source link

`dc list all` fails - unhandled exception #15

Closed jtmcdole closed 3 years ago

jtmcdole commented 3 years ago

Context

Describe the bug Run "/dc list all", receive error in console. Server logs show:

[20:46:36 INFO]: codefu issued server command: /dc list all
[20:46:36 ERROR]: null
org.bukkit.command.CommandException: Unhandled exception executing command 'dc' in plugin DeadChest v4.6.0
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[patched_1.17.1.jar:git-Paper-168]
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:159) ~[patched_1.17.1.jar:git-Paper-168]
        at org.bukkit.craftbukkit.v1_17_R1.CraftServer.dispatchCommand(CraftServer.java:832) ~[patched_1.17.1.jar:git-Paper-168]
        at net.minecraft.server.network.ServerGamePacketListenerImpl.handleCommand(ServerGamePacketListenerImpl.java:2170) ~[app:?]
        at net.minecraft.server.network.ServerGamePacketListenerImpl.handleChat(ServerGamePacketListenerImpl.java:1981) ~[app:?]
        at net.minecraft.server.network.ServerGamePacketListenerImpl.handleChat(ServerGamePacketListenerImpl.java:1962) ~[app:?]
        at net.minecraft.network.protocol.game.ServerboundChatPacket.handle(ServerboundChatPacket.java:46) ~[app:?]
        at net.minecraft.network.protocol.game.ServerboundChatPacket.handle(ServerboundChatPacket.java:6) ~[app:?]
        at net.minecraft.network.protocol.PacketUtils.lambda$ensureRunningOnSameThread$1(PacketUtils.java:36) ~[app:?]
        at net.minecraft.server.TickTask.run(TickTask.java:18) ~[patched_1.17.1.jar:git-Paper-168]
        at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:149) ~[app:?]
        at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:23) ~[app:?]
        at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1348) ~[patched_1.17.1.jar:git-Paper-168]
        at net.minecraft.server.MinecraftServer.shouldRun(MinecraftServer.java:190) ~[patched_1.17.1.jar:git-Paper-168]
        at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:122) ~[app:?]
        at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1327) ~[patched_1.17.1.jar:git-Paper-168]
        at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1320) ~[patched_1.17.1.jar:git-Paper-168]
        at net.minecraft.util.thread.BlockableEventLoop.runAllTasks(BlockableEventLoop.java:110) ~[app:?]
        at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1458) ~[patched_1.17.1.jar:git-Paper-168]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1188) ~[patched_1.17.1.jar:git-Paper-168]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:316) ~[patched_1.17.1.jar:git-Paper-168]
        at java.lang.Thread.run(Thread.java:831) [?:?]
Caused by: java.lang.NullPointerException: Cannot invoke "org.bukkit.World.getName()" because the return value of "org.bukkit.Location.getWorld()" is null
        at me.crylonz.commands.DCCommandExecutor.onCommand(DCCommandExecutor.java:235) ~[DeadChest-4.6.0.jar:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[patched_1.17.1.jar:git-Paper-168]
        ... 21 more

To Reproduce Steps to reproduce the behavior:

  1. Log in
  2. Run /dc list all
  3. See error

Other: Running multiverse-core, but this is on my overworld.

apavarino commented 3 years ago

Fixed for version 4.7.0