NPE by checking, if configurationpath is null

Discussion in 'Plugin Development' started by TheA13X, May 24, 2013.

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

    TheA13X

    Everytime I try to make something like that:
    Code:
    if(act.getConfig().get("player."+e.getPlayer().getName()+".activated").equals(null)){
    The Server gives me a NPE and I don't get what I'm making wrong!
    Please help.
     
  2. Offline

    Tzeentchful

    TheA13X
    You cant do...
    Code:java
    1. .equals(null))

    If you want to see if the config doesn't contain an item you can do this.
    Code:java
    1. getConfig().isSet("you.path.here");
     
  3. Offline

    TheA13X

    Thanks. I'll try it.
     
Thread Status:
Not open for further replies.

Share This Page