GetAuditLog: Fix NPE if group UUID cannot be resolved

A group UUID cannot be resolved if there is no groupback that handles
it. This can e.g. happen if the singleusergroup was used and single user
groups have been added to Gerrit groups, but then the singleusergroup
plugin was uninstalled.

Change-Id: I87b83c3904172e8ff32cfd07c15e9a9951921c71
Signed-off-by: Edwin Kempin <ekempin@google.com>
(cherry picked from commit 3e20db09ec)
This commit is contained in:
Edwin Kempin 2018-03-26 11:14:49 +02:00 committed by Bassem Rabil
parent aaa40aa1b8
commit ef335f6518
1 changed files with 3 additions and 1 deletions

View File

@ -108,7 +108,9 @@ public class GetAuditLog implements RestReadView<GroupResource> {
GroupDescription.Basic groupDescription = groupBackend.get(includedGroupUUID);
member = new GroupInfo();
member.id = Url.encode(includedGroupUUID.get());
member.name = groupDescription.getName();
if (groupDescription != null) {
member.name = groupDescription.getName();
}
}
auditEvents.add(