NullPointerException... for no reason...

Discussion in 'Plugin Development' started by DiamGamingWTF, Apr 6, 2014.

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

    DiamGamingWTF

    Right, this is straight forward, you DO NOT need any proof of code. You DO NOT need to examine my code. This is a simple error that I find... confusing.

    My code works fine, the error occurs on a line with NO CODE on it. It is a blank line (line 53) no code on it, no checks, no requests, no notes and no comments. It is a blank line and it is comming up with a NullPointerException. What is up with that? Could someone tell me the reason for this.

    PS. The event is a PlayerInterectEvent and happeneds when the item in the hand is nothing and right clicking a block. Yes, i have checked for the correct item and done a Null check, but this is just stupid that it is happening on a blank line.
     
  2. Offline

    xTrollxDudex

    DiamGamingWTF
    Show code anyways. Make sure jar file is using latest code.
     
  3. Offline

    St3venAU

    I doubt you will get any answers here without posting the code and the stack trace.
     
  4. Offline

    adam753

    DiamGamingWTF
    Is it possible the error is coming from a different version of the jar file than the code you're looking at?
     
  5. Offline

    itzrobotix

    So why can't you show us a few lines around that area?
     
  6. Make sure that you're using the jar of the source you're working with,
    it won't just throw an NPE and point at nothing.

    Once you're using the correct jar, you can inspect what's on that line.
    If there are a lot of things on that specific line that could cause an NPE,
    a trick I often use is to put things on seperate lines and check again.

    After that you just have to track down what went wrong with initializing the object.
     
  7. Offline

    Maurdekye

    DiamGamingWTF Delete the jar you're currently using, and then build it again. If it doesn't appear, then you're exporting it to the wrong directory. I've done this many times in my day.
     
Thread Status:
Not open for further replies.

Share This Page