getDataFolder().getPath() returning null

Discussion in 'Plugin Development' started by william9518, Jan 5, 2013.

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

    william9518

    So I used it like this :
    public String mainDir = getDataFolder().getPath();
    and when I opened teh server it said in the stacktrace
    line 38 in my plugin error
    caused by Java Nullpointerexception

    and line 38 is:
    public String mainDir = getDataFolder().getPath();
     
  2. Offline

    fireblast709

    don't use getDataFolder() before onEnable() is called ... -_-
     
  3. Offline

    william9518

    whoops
     
Thread Status:
Not open for further replies.

Share This Page