Properly throw IllegalArgumentException in UserCommandElement
@@ -1160,7 +1160,8 @@ protected Object parseValue(CommandSource source, CommandArgs args) throws Argum
@Override
protected Object getValue(String choice) throws IllegalArgumentException {
- return Sponge.getGame().getServiceManager().provideUnchecked(UserStorageService.class).get(choice).get();
+ return Sponge.getGame().getServiceManager().provideUnchecked(UserStorageService.class).get(choice)
+ .orElseThrow(() -> new IllegalArgumentException("Input value '" + choice + "' was not a user!"));
}
@Override
