Solved error in console after updating an plugin

Discussion in 'Plugin Development' started by _Chazzie_, Jun 27, 2017.

Thread Status:
Not open for further replies.
  1. hello
    i was updating an plugin of myself and i get an error as i do /sc without permission.
    here's the error

    Code:
     null
    org.bukkit.command.CommandException: Unhandled exception executing command 'sc' in plugin staffChat_nl v1.5
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[minecraft.jar:git-Spigot-d276ab1-d219213]
            at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141) ~[minecraft.jar:git-Spigot-d276ab1-d219213]
            at org.bukkit.craftbukkit.v1_11_R1.CraftServer.dispatchCommand(CraftServer.java:650) ~[minecraft.jar:git-Spigot-d276ab1-d219213]
            at net.minecraft.server.v1_11_R1.PlayerConnection.handleCommand(PlayerConnection.java:1353) [minecraft.jar:git-Spigot-d276ab1-d219213]
            at net.minecraft.server.v1_11_R1.PlayerConnection.a(PlayerConnection.java:1188) [minecraft.jar:git-Spigot-d276ab1-d219213]
            at net.minecraft.server.v1_11_R1.PacketPlayInChat.a(PacketPlayInChat.java:45) [minecraft.jar:git-Spigot-d276ab1-d219213]
            at net.minecraft.server.v1_11_R1.PacketPlayInChat.a(PacketPlayInChat.java:1) [minecraft.jar:git-Spigot-d276ab1-d219213]
            at net.minecraft.server.v1_11_R1.PlayerConnectionUtils$1.run(SourceFile:13) [minecraft.jar:git-Spigot-d276ab1-d219213]
            at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_121]
            at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_121]
            at net.minecraft.server.v1_11_R1.SystemUtils.a(SourceFile:46) [minecraft.jar:git-Spigot-d276ab1-d219213]
            at net.minecraft.server.v1_11_R1.MinecraftServer.D(MinecraftServer.java:747) [minecraft.jar:git-Spigot-d276ab1-d219213]
            at net.minecraft.server.v1_11_R1.DedicatedServer.D(DedicatedServer.java:399) [minecraft.jar:git-Spigot-d276ab1-d219213]
            at net.minecraft.server.v1_11_R1.MinecraftServer.C(MinecraftServer.java:678) [minecraft.jar:git-Spigot-d276ab1-d219213]
            at net.minecraft.server.v1_11_R1.MinecraftServer.run(MinecraftServer.java:576) [minecraft.jar:git-Spigot-d276ab1-d219213]
            at java.lang.Thread.run(Unknown Source) [?:1.8.0_121]
    Caused by: java.lang.NullPointerException
            at chat.Main.onCommand(Main.java:25) ~[?:?]
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[minecraft.jar:git-Spigot-d276ab1-d219213]
            ... 15 more
    can anybody help me?
     
  2. Offline

    InstanceofDeath

    Well you always find your Exception at Caused by: java.lang.NullPointerException

    This Exception means that one Field or Method on an object refers to a NULL Reference
    d.h. that something returns NULL which isn't allowed in many cases.

    Now you go in your main class to line 25 in your onCommand method and try to find the thing that returns NULL.

    An easy to fix it would build an if-clause around it and just null check, before you are creating a variable or you just write the line and post it and we will help you here ;)
     
  3. i already fixed it
     
  4. Offline

    Zombie_Striker

    @_Chazzie_
    If your problem has been solved, mark this thread as solved.
     
Thread Status:
Not open for further replies.

Share This Page