Really need help!: config.getNodes("RedstoneCommand.Locations").isEmpty() prints a NullException

Discussion in 'Plugin Development' started by homerbond005, Jun 5, 2011.

Thread Status:
Not open for further replies.
  1. The title says it all:
    System.out.println(config.getNodes("RedstoneCommand.Locations").isEmpty());
    prints an NullException.
    Don't know what to do.
     
  2. Offline

    garbagemule

    Configuration is a bit wonky. Use getKeys() instead :)
     
  3. It doesn't work. Same failure.
     
  4. if "RedstoneCommand.Locations" does not exist, config.getNodes("RedstoneCommand.Locations") returns a null object, which does not contain any functions.

    use
    if(config.getNodes("RedstoneCommand.Locations")==null) instead to check if it exists, then use isEmpty to check if it was just an empty node
     
Thread Status:
Not open for further replies.

Share This Page