Solved Weird nullpointer error

Discussion in 'Plugin Development' started by jekeke123, Aug 9, 2014.

Thread Status:
Not open for further replies.
  1. Hello everyone,

    I'm having a nullpointer error and i don't know why because i'm checking if it's null...
    Maybe someone can help me finding a solution.
    Code:
    String FactionRole = "";
                                if (fplayer.getRole().toString() != null){
                                    FactionRole = fplayer.getRole().toString();
                                }
    Kind Regards,
    Jasper,
     
  2. Offline

    Rocoty

    From what I can see, fplayer may be null, and fplayer.getRole() might return null. You're not checking those.
     
    jekeke123 likes this.
  3. Rocoty Yeah i'm trying to check fplayer.getrole() now and fplayer is nut null there is a check but just didn't post that
    €dit: ok fixed with checking fplayer.getrole();
     
Thread Status:
Not open for further replies.

Share This Page