Skip to content

Commit cde5990

Browse files
authored
bugfix: fix login() once again accepts null subject (#2807)
1 parent a3dfb8a commit cde5990

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

core/src/main/java/org/apache/shiro/mgt/DefaultSecurityManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ public Subject login(Subject subject, AuthenticationToken token) throws Authenti
305305
* @param subject Subject
306306
*/
307307
protected void beforeSuccessfulLogin(Subject subject) {
308-
Session session = subject.getSession(false);
308+
Session session = subject != null ? subject.getSession(false) : null;
309309
if (session != null) {
310310
Map<Object, Object> attributes = new HashMap<>();
311311
session.getAttributeKeys().forEach(key -> attributes.put(key, session.getAttribute(key)));

0 commit comments

Comments
 (0)