Solved Error: null when saving

Discussion in 'Plugin Development' started by Tsa6, Nov 30, 2015.

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

    Tsa6

    I'm trying to save a String to my config.yml, but when I try to save, the console outputs "[15:28:09 ERROR]: null" followed by a null pointer exception. I've made sure that I am not passing in a null value, nor is the key null, but am still getting the error. I can provide more information if needed. Any help is appreciated.

    Saving
    Code:
    mainClass.getConfig().getConfigurationSection("mines").set(args[0], mine.toString());
    Full class, log snippet
     
  2. Offline

    mcdorli

    Can you create a picture of the config file whle you're looking at the mines section? (Before anyoone begins to screan, yes, I need the whole screen) and the mine class
     
  3. Offline

    Tsa6

    One isn't being created. I now see that I was missing a saveConfig, but even after adding one nothing is created
     
  4. Offline

    Scimiguy

    Show your full class.
     
  5. Offline

    Tsa6

    I have. It's posted up above, but here's another link if you want one. There is the main class and the mine class, but the main one pretty much just registers the command, and the problem seems to be unconnected from the mine class, as I have checked the outputs to make sure they are how they should be.
     
  6. Offline

    Zombie_Striker

    1. Is mainClass null?
    2. Is the config null?
    3. Does the configuaration section "mines" exist?
    4. Is args[0] null?
    5. Is mine null?
    6. is the .toString() method returning null?
    Debug. Test which is null by using the following:
    Code:
    if(Object == null){
        System.out.println("The thing is null.");
    }
     
Thread Status:
Not open for further replies.

Share This Page