Skip Null List Elements When Mapping CAS Attributes To Authorities
The io.spring.nullability plugin 0.0.16 upgrade tightens NullAway analysis and flags list elements from the unannotated, raw List<?> attribute value as possibly null. A null element has no value to contribute to an authority, consistent with how a null attribute value as a whole is already skipped. See gh-19670 Signed-off-by: Josh Cummings <3627351+jzheaux@users.noreply.github.com>
This commit is contained in:
+3
-1
@@ -61,7 +61,9 @@ public final class GrantedAuthorityFromAssertionAttributesUserDetailsService
|
||||
if (value != null) {
|
||||
if (value instanceof List) {
|
||||
for (Object o : (List<?>) value) {
|
||||
grantedAuthorities.add(createSimpleGrantedAuthority(o));
|
||||
if (o != null) {
|
||||
grantedAuthorities.add(createSimpleGrantedAuthority(o));
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user