Skip to content

Commit d0014f6

Browse files
JokerSunJokerSun
authored and
JokerSun
committed
AuthorityUtils Null Check
Fixes: gh-6773
1 parent a6cbc90 commit d0014f6

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

core/src/main/java/org/springframework/security/core/authority/AuthorityUtils.java

+2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
import org.springframework.security.core.GrantedAuthority;
2626
import org.springframework.util.StringUtils;
27+
import org.springframework.util.Assert;
2728

2829
/**
2930
* Utility method for manipulating <tt>GrantedAuthority</tt> collections etc.
@@ -55,6 +56,7 @@ public static List<GrantedAuthority> commaSeparatedStringToAuthorityList(
5556
*/
5657
public static Set<String> authorityListToSet(
5758
Collection<? extends GrantedAuthority> userAuthorities) {
59+
Assert.notNull(userAuthorities, "userAuthorities cannot be null");
5860
Set<String> set = new HashSet<>(userAuthorities.size());
5961

6062
for (GrantedAuthority authority : userAuthorities) {

0 commit comments

Comments
 (0)