[Solved] Weird configuration section check

Discussion in 'Spigot Plugin Development' started by RandomPanda30, May 23, 2015.

  1. Hello there, I currently have this in my configuration -

    Code (Text):
    Ores: []
    That section basically stores a list of things and as you can see, it's got nothing in it. However, checking if it's null only brings up errors such as NPEs.

    I've tried doing things such as:

    Code (Text):
            if (!Murge.cso.getDumpC().getConfigurationSection("Ores")
                    .getKeys(false).isEmpty()) {
    And others but for some reason, it errors and doesn't check. Is there anything I can do about this? Can I check some other way? Rather bummed out that it's not working at the moment.

    ~ Panda
     
  2. Ores wouldn't be a configuration section but a list when using []

    When you do getConfigurationSection( "Ores" ) it's returning null, so you can't call #getKeys on it.
     
  3. Well I feel very stupid but also educated. I don't believe how I didn't see this ;P Thank you!