diff --git a/services/src/main/java/org/keycloak/services/resources/AccountService.java b/services/src/main/java/org/keycloak/services/resources/AccountService.java index 8f864ac10d..d6414412b9 100755 --- a/services/src/main/java/org/keycloak/services/resources/AccountService.java +++ b/services/src/main/java/org/keycloak/services/resources/AccountService.java @@ -249,10 +249,12 @@ public class AccountService { if (auth != null) { List events = auditProvider.createQuery().event(AUDIT_EVENTS).user(auth.getUser().getId()).maxResults(30).getResultList(); for (Event e : events) { - Iterator> itr = e.getDetails().entrySet().iterator(); - while (itr.hasNext()) { - if (!AUDIT_DETAILS.contains(itr.next().getKey())) { - itr.remove(); + if (e.getDetails() != null) { + Iterator> itr = e.getDetails().entrySet().iterator(); + while (itr.hasNext()) { + if (!AUDIT_DETAILS.contains(itr.next().getKey())) { + itr.remove(); + } } } }