Solved Checking empty argument bug

Discussion in 'Plugin Development' started by Aragone, Jul 10, 2019.

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

    Aragone

    Hello,

    I would like to check if the argument <player_name> is empty in the command /troc start <player_name>. I tried that but it doesn't work. Also, I tried args[1].equals(null) == true, !args[1].equals(null) == false, but nothing is running.

    When I put an argument as a player name, the plugin run well. But when I put nothing, I have an error message.

    upload_2019-7-10_14-29-43.png

    Thanks for you help.

    Code : https://pastebin.com/raw/g6apnpv3
     
  2. Online

    timtower Administrator Administrator Moderator

    @Aragone An argument is never empty.
    But you are not checking if the args length ==2 there.
     
  3. Offline

    Aragone

    Oh pfff yes I undertand x) That was very simple...
     
    timtower likes this.
Thread Status:
Not open for further replies.

Share This Page