Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty String argument possible with two subsequent String parameters #322

Open
petomka opened this issue Apr 26, 2021 · 0 comments
Open
Labels

Comments

@petomka
Copy link

petomka commented Apr 26, 2021

Consider the following code (to create a chatroom, in this particular case) in a command:

@Subcommand("create")
public void create(CommandSender sender, @Single String name, @Single @Optional String password) {
	// some action
}

If a user types /room_create__something (please think of _ as a space, a double space was formatted away in this editor) name is an empty string and password will be something (because of the double space between create and something!)
As you cannot call other commands that have a String parameter as the last parameter with an empty string by just adding spaces (e.g. /room_delete__), I doubt that this works as intended - I would expect the second argument to actually be the second argument instead of supplying me with an empty string.

@chickeneer chickeneer added the bug label Jun 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants