Summary
Adding a blank list of users to a group in Crowd results in an HTML 500 error, plus an unhelpful entry in the Crowd logs.
Steps to Reproduce
- Send a REST API call to add users to a group, but pass an empty list of users
/crowd/rest/usermanagement/1/group/user/direct?groupname=GROUP_NAME_HERE
Expected Results
An error will be returned that no users were provided
Actual Results
- The Crowd logs will show:
2018-08-06 17:04:03,565 http-nio-8095-exec-70 ERROR [common.error.jersey.ThrowableExceptionMapper] Uncaught exception thrown by REST service: The validated object is null
java.lang.NullPointerException: The validated object is null
at org.apache.commons.lang3.Validate.notNull(Validate.java:225)
at org.apache.commons.lang3.Validate.notNull(Validate.java:206)
at com.atlassian.crowd.manager.application.AliasManagerImpl.findUsernameByAlias(AliasManagerImpl.java:38)
at sun.reflect.GeneratedMethodAccessor539.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
- The access logs will show a 500 error:
[06/Aug/2018:17:04:03 +0200] Go-http-client/1.1 123.456.789.20 123.456.789.123 POST POST /crowd/rest/usermanagement/1/group/user/direct?groupname=GROUP_NAME_HERE HTTP/1.1 2767 500 http-nio-8095-exec-70 -