added sanity check for non-existent or empty last-login value
This commit is contained in:
parent
8b5f3fe967
commit
b0671c4d4c
|
@ -40,7 +40,9 @@ public class LastLoginEventListenerProvider implements EventListenerProvider {
|
|||
Map<String, List<String>> userAttrs = user.getAttributes();
|
||||
if (userAttrs.containsKey("last-login")) {
|
||||
String userLastLogin = userAttrs.get("last-login").get(0);
|
||||
user.setSingleAttribute("prior-login", userLastLogin);
|
||||
if (userLastLogin != null && !userLastLogin.isEmpty()) {
|
||||
user.setSingleAttribute("prior-login", userLastLogin);
|
||||
}
|
||||
}
|
||||
|
||||
// Use current server time for login event
|
||||
|
|
Reference in a new issue