Solved NullPointerException at events

Discussion in 'Plugin Development' started by Goksi, Jan 12, 2018.

Thread Status:
Not open for further replies.
  1. Offline

    Goksi

    Hi im trying to make simple freeze plugin with hashmaps, everything works fine but when i do event when i am not "frozen" (etc. BlockPlaceEvent) it returns me NPE

    Error BlockPlaceEvent while not "Frozen": https://pastebin.com/pXMG5pZw

    Commands class:
    https://pastebin.com/Kj76rf9a

    Line 130 in Commands:
    Code:
    if(Commands.ss.get(p.getName()))
    It gives me npe even if i checked this before:
    Code:
    if (Commands.ss.get(igrac.getName()) == null) {
                            Commands.ss.put(igrac.getName(), false);
                        }
     
  2. Offline

    timtower Administrator Administrator Moderator

    @Goksi What is the value of Commands.ss
     
  3. Offline

    Goksi

    @timtower Value is boolean and key is string(player name)
     
  4. Offline

    timtower Administrator Administrator Moderator

    Print the value of Commands.ss to the console
     
  5. Offline

    Goksi

    Last edited: Jan 12, 2018
Thread Status:
Not open for further replies.

Share This Page