NullPointerException, please help :)

Discussion in 'Plugin Development' started by halvors, Apr 8, 2011.

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

    halvors

    Hi!

    Have some problems with my plugin LocalChat, and can't figure out what's wrong, have been tested it for 5 hours now. No result :(

    It's to much for paste here but please check my code at:

    Basicly i am trying to call a list of classes in my plugin main file: https://github.com/halvors/LocalChat/tree/experimental/com/halvors/LocalChat
    Code:
    try {
        List<Group> g = this.getGroupManager().getGroups();
    
         for (int i = 0; i < g.size(); i++) {
             log.info("Test: " + g.get(i).getName());
         }
    } catch (Exception e) {
        log.info("Test: Something went wrong.");
    }
    
    Would be really nice if someone could help me :)
     
  2. Offline

    halvors

    Nobody here who is able to help me? I'm really stuck here, so please try if you can :)
     
  3. Offline

    Crash

    Where do you ever set groupManager to a new instance of GroupManager ?
    Calling getGroupManager will return null.
     
  4. Offline

    halvors

    getGroupManager() is not the GroupManager plugin, but a class in my plugin, look at my source ;D
     
  5. Offline

    rcjrrjcr

    You need to construct a new instance of GroupManager in onEnable().
     
  6. Offline

    halvors

    Thanks, i didn't see that :D
     
Thread Status:
Not open for further replies.

Share This Page