Make sure to check for correct arguments.

This commit is contained in:
tastybento 2019-02-20 11:03:58 -08:00
parent e44894a803
commit 212c690117

View File

@ -33,6 +33,11 @@ public class AdminUnregisterCommand extends ConfirmableCommand {
@Override @Override
public boolean canExecute(User user, String label, List<String> args) { public boolean canExecute(User user, String label, List<String> args) {
// If args are not right, show help
if (args.size() != 1) {
showHelp(this, user);
return false;
}
// Get target // Get target
UUID targetUUID = getPlayers().getUUID(args.get(0)); UUID targetUUID = getPlayers().getUUID(args.get(0));
if (targetUUID == null) { if (targetUUID == null) {
@ -48,11 +53,6 @@ public class AdminUnregisterCommand extends ConfirmableCommand {
@Override @Override
public boolean execute(User user, String label, List<String> args) { public boolean execute(User user, String label, List<String> args) {
// If args are not right, show help
if (args.size() != 1) {
showHelp(this, user);
return false;
}
// Get target // Get target
UUID targetUUID = getPlayers().getUUID(args.get(0)); UUID targetUUID = getPlayers().getUUID(args.get(0));
// Everything's fine, we can set the island as spawn :) // Everything's fine, we can set the island as spawn :)