NullPointerException while searching for a string

Discussion in 'Plugin Development' started by immapoint, Jan 16, 2011.

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

    immapoint

    Hey there,

    i'm currently working on a simpler version of Towny for bukkit.
    Just special users are allowed to create towns. So i have a file, "town_permits.txt", where all these users are listed.

    The problem is:
    I try to search for the current user in the file, if he wants to create a town:
    Code:
    townpermissions = new FileReader("town_permits.txt");
    BufferedReader topere = new BufferedReader(townpermissions);
    String bfr = "";
    do{
         try {
                bfr = topere.readLine();
                permitlines.add(bfr);
            System.out.println(bfr);
         }
         // catch...
     
    } while ( bfr != null);
    
    for ( int i = 0; i < permitlines.size(); i++){
    
        if ( permitlines.get(i).contains(actor.getName())){
    
                permission = true;
    
        }
    
    }
    Error is:
    I can't imagine what that means:confused:

    Thanks for any help,
    immapoint
     
  2. Offline

    DjDCH

    Can we have the full content of this file : "D3Player.java". The error come from the line 12, so I want to know what happen exactly there.
     
Thread Status:
Not open for further replies.

Share This Page