SEC-1372: Return an empty list rather than null from SessionRegistryImpl.getAllSessions()
If the principal has no sessions, null is returned which contradicts the interface contract. In practice it didn't matter as the null was checked for, but it is cleaner to disallow a null value.
This commit is contained in:
+1
-1
@@ -69,7 +69,7 @@ public class ConcurrentSessionControlStrategy extends SessionFixationProtectionS
|
||||
|
||||
final List<SessionInformation> sessions = sessionRegistry.getAllSessions(authentication.getPrincipal(), false);
|
||||
|
||||
int sessionCount = sessions == null ? 0 : sessions.size();
|
||||
int sessionCount = sessions.size();
|
||||
int allowedSessions = getMaximumSessionsForThisUser(authentication);
|
||||
|
||||
if (sessionCount < allowedSessions) {
|
||||
|
||||
Reference in New Issue
Block a user