Nullchecker help

Discussion in 'Plugin Development' started by desup, Feb 10, 2012.

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

    desup

    Hi, I have got problem with my nullchecker and I dont know why.
    I am getting an error Unhandled exception on line 34 which looks like this
    Code:
    if(args[0].length() == 0
          || args[1].length() == 0)
    {
    //something
    }
    34 is the first one.
    I thought that error is in the || (OR) statement.
    But I dont know.
    *Before nullchecker is just Command name checker
     
  2. Offline

    Ice_Sword

    You could try catching the NullPointerException. Do you know how to use try and catch?
     
  3. Offline

    desup

    Yeah, I have already worked with it to catch Stack trace, but Im to sure.
    Can you help me? :)
     
  4. i think you want to check if the argument length is 1 or 2 right?
    then you would use
    Code:
    args.length
    instead of your code. (yes, you don't need the brackets, because it's a variable)
     
Thread Status:
Not open for further replies.

Share This Page