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) {
List<Event> events = auditProvider.createQuery().event(AUDIT_EVENTS).user(auth.getUser().getId()).maxResults(30).getResultList();
for (Event e : events) {
Iterator<Map.Entry<String, String>> itr = e.getDetails().entrySet().iterator();
while (itr.hasNext()) {
if (!AUDIT_DETAILS.contains(itr.next().getKey())) {
itr.remove();
if (e.getDetails() != null) {
Iterator<Map.Entry<String, String>> itr = e.getDetails().entrySet().iterator();
while (itr.hasNext()) {
if (!AUDIT_DETAILS.contains(itr.next().getKey())) {
itr.remove();
}
}
}
}