Fix NPE in account service

This commit is contained in:
Stian Thorgersen 2014-05-21 12:13:00 +01:00
parent d68131ac00
commit 6814230193

View file

@ -249,10 +249,12 @@ public class AccountService {
if (auth != null) { if (auth != null) {
List<Event> events = auditProvider.createQuery().event(AUDIT_EVENTS).user(auth.getUser().getId()).maxResults(30).getResultList(); List<Event> events = auditProvider.createQuery().event(AUDIT_EVENTS).user(auth.getUser().getId()).maxResults(30).getResultList();
for (Event e : events) { for (Event e : events) {
Iterator<Map.Entry<String, String>> itr = e.getDetails().entrySet().iterator(); if (e.getDetails() != null) {
while (itr.hasNext()) { Iterator<Map.Entry<String, String>> itr = e.getDetails().entrySet().iterator();
if (!AUDIT_DETAILS.contains(itr.next().getKey())) { while (itr.hasNext()) {
itr.remove(); if (!AUDIT_DETAILS.contains(itr.next().getKey())) {
itr.remove();
}
} }
} }
} }